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

Function bitcoind_getrawblockbyheight_

lightningd/bitcoind.c:469–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467}
468
469void bitcoind_getrawblockbyheight_(const tal_t *ctx,
470 struct bitcoind *bitcoind,
471 u32 height,
472 void (*cb)(struct bitcoind *bitcoind,
473 u32 blockheight,
474 struct bitcoin_blkid *blkid,
475 struct bitcoin_block *blk,
476 void *arg),
477 void *cb_arg)
478{
479 struct jsonrpc_request *req;
480 struct getrawblockbyheight_call *call = tal(ctx,
481 struct getrawblockbyheight_call);
482
483 call->bitcoind = bitcoind;
484 call->cb = cb;
485 call->cb_arg = cb_arg;
486 call->height = height;
487
488 trace_span_start("plugin/bitcoind", call);
489 trace_span_tag(call, "method", "getrawblockbyheight");
490 trace_span_suspend(call);
491 req = jsonrpc_request_start(call, "getrawblockbyheight", NULL,
492 bitcoind->log,
493 NULL, getrawblockbyheight_callback,
494 call);
495 json_add_num(req->stream, "height", height);
496 jsonrpc_request_end(req);
497 bitcoin_plugin_send(bitcoind, req);
498}
499
500/* `getchaininfo`
501 *

Callers

nothing calls this directly

Calls 4

trace_span_tagFunction · 0.85
json_add_numFunction · 0.85
bitcoin_plugin_sendFunction · 0.85
jsonrpc_request_endFunction · 0.70

Tested by

no test coverage detected