| 467 | } |
| 468 | |
| 469 | void 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 | * |
nothing calls this directly
no test coverage detected