MCPcopy Create free account
hub / github.com/ElementsProject/lightning / bitcoind_getrawblockbyheight_

Function bitcoind_getrawblockbyheight_

lightningd/bitcoind.c:388–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388void bitcoind_getrawblockbyheight_(struct bitcoind *bitcoind,
389 u32 height,
390 void (*cb)(struct bitcoind *bitcoind,
391 struct bitcoin_blkid *blkid,
392 struct bitcoin_block *blk,
393 void *arg),
394 void *cb_arg)
395{
396 struct jsonrpc_request *req;
397 struct getrawblockbyheight_call *call = tal(NULL,
398 struct getrawblockbyheight_call);
399
400 call->bitcoind = bitcoind;
401 call->cb = cb;
402 call->cb_arg = cb_arg;
403
404 req = jsonrpc_request_start(bitcoind, "getrawblockbyheight", NULL,
405 bitcoind->log,
406 NULL, getrawblockbyheight_callback,
407 call);
408 json_add_num(req->stream, "height", height);
409 jsonrpc_request_end(req);
410 bitcoin_plugin_send(bitcoind, req);
411}
412
413/* `getchaininfo`
414 *

Callers

nothing calls this directly

Calls 3

bitcoin_plugin_sendFunction · 0.85
jsonrpc_request_endFunction · 0.70
json_add_numFunction · 0.50

Tested by

no test coverage detected