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

Function bitcoind_getchaininfo_

lightningd/bitcoind.c:551–575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549}
550
551void bitcoind_getchaininfo_(const tal_t *ctx,
552 struct bitcoind *bitcoind,
553 const u32 height,
554 void (*cb)(struct bitcoind *bitcoind,
555 const char *chain,
556 u32 headercount,
557 u32 blockcount,
558 const bool ibd,
559 void *),
560 void *cb_arg)
561{
562 struct jsonrpc_request *req;
563 struct getchaininfo_call *call = tal(ctx, struct getchaininfo_call);
564
565 call->bitcoind = bitcoind;
566 call->cb = cb;
567 call->cb_arg = cb_arg;
568
569 req = jsonrpc_request_start(call, "getchaininfo", NULL,
570 bitcoind->log,
571 NULL, getchaininfo_callback, call);
572 json_add_u32(req->stream, "last_height", height);
573 jsonrpc_request_end(req);
574 bitcoin_plugin_send(bitcoind, req);
575}
576
577/* `getutxout`
578 *

Callers

nothing calls this directly

Calls 3

json_add_u32Function · 0.85
bitcoin_plugin_sendFunction · 0.85
jsonrpc_request_endFunction · 0.70

Tested by

no test coverage detected