@@ -455,7 +455,9 @@ void bitcoind_sendrawtx_(const tal_t *ctx,
455455
456456struct getrawblockbyheight_call {
457457 struct bitcoind * bitcoind ;
458+ u32 height ;
458459 void (* cb )(struct bitcoind * bitcoind ,
460+ u32 height ,
459461 struct bitcoin_blkid * blkid ,
460462 struct bitcoin_block * block ,
461463 void * );
@@ -477,7 +479,7 @@ getrawblockbyheight_callback(const char *buf, const jsmntok_t *toks,
477479 * with NULL values. */
478480 err = json_scan (tmpctx , buf , toks , "{result:{blockhash:null}}" );
479481 if (!err ) {
480- call -> cb (call -> bitcoind , NULL , NULL , call -> cb_arg );
482+ call -> cb (call -> bitcoind , call -> height , NULL , NULL , call -> cb_arg );
481483 goto clean ;
482484 }
483485
@@ -496,7 +498,7 @@ getrawblockbyheight_callback(const char *buf, const jsmntok_t *toks,
496498 "getrawblockbyheight" ,
497499 "bad block" );
498500
499- call -> cb (call -> bitcoind , & blkid , blk , call -> cb_arg );
501+ call -> cb (call -> bitcoind , call -> height , & blkid , blk , call -> cb_arg );
500502
501503clean :
502504 tal_free (call );
@@ -505,6 +507,7 @@ getrawblockbyheight_callback(const char *buf, const jsmntok_t *toks,
505507void bitcoind_getrawblockbyheight_ (struct bitcoind * bitcoind ,
506508 u32 height ,
507509 void (* cb )(struct bitcoind * bitcoind ,
510+ u32 blockheight ,
508511 struct bitcoin_blkid * blkid ,
509512 struct bitcoin_block * blk ,
510513 void * arg ),
@@ -517,6 +520,7 @@ void bitcoind_getrawblockbyheight_(struct bitcoind *bitcoind,
517520 call -> bitcoind = bitcoind ;
518521 call -> cb = cb ;
519522 call -> cb_arg = cb_arg ;
523+ call -> height = height ;
520524
521525 trace_span_start ("plugin/bitcoind" , call );
522526 trace_span_tag (call , "method" , "getrawblockbyheight" );
@@ -724,6 +728,7 @@ process_getfilteredblock_step2(struct bitcoind *bitcoind,
724728}
725729
726730static void process_getfilteredblock_step1 (struct bitcoind * bitcoind ,
731+ u32 height ,
727732 struct bitcoin_blkid * blkid ,
728733 struct bitcoin_block * block ,
729734 struct filteredblock_call * call )
0 commit comments