@@ -515,19 +515,19 @@ pub(crate) async fn generate_blocks_and_wait<E: ElectrumApi>(
515515 let _ = bitcoind. create_wallet ( "ldk_node_test" ) ;
516516 let _ = bitcoind. load_wallet ( "ldk_node_test" ) ;
517517 print ! ( "Generating {} blocks..." , num) ;
518- let blockchain_info = bitcoind. get_blockchain_info ( ) . expect ( "failed to get blockchain info" ) ;
519- let cur_height = blockchain_info . blocks ;
518+ // let blockchain_info = bitcoind.get_blockchain_info().expect("failed to get blockchain info");
519+ let cur_height: usize = bitcoind . call ( "getblockcount" , & [ ] ) . expect ( "failed to get block count" ) ;
520520 let address = bitcoind. new_address ( ) . expect ( "failed to get new address" ) ;
521521 // TODO: expect this Result once the WouldBlock issue is resolved upstream.
522522 let _block_hashes_res = bitcoind. generate_to_address ( num, & address) ;
523- wait_for_block ( electrs, cur_height as usize + num) . await ;
523+ wait_for_block ( electrs, cur_height + num) . await ;
524524 print ! ( " Done!" ) ;
525525 println ! ( "\n " ) ;
526526}
527527
528528pub ( crate ) fn invalidate_blocks ( bitcoind : & BitcoindClient , num_blocks : usize ) {
529- let blockchain_info = bitcoind. get_blockchain_info ( ) . expect ( "failed to get blockchain info" ) ;
530- let cur_height = blockchain_info . blocks as usize ;
529+ // let blockchain_info = bitcoind.get_blockchain_info().expect("failed to get blockchain info");
530+ let cur_height: usize = bitcoind . call ( "getblockcount" , & [ ] ) . expect ( "failed to get block count" ) ;
531531 let target_height = cur_height - num_blocks + 1 ;
532532 let block_hash = bitcoind
533533 . get_block_hash ( target_height as u64 )
0 commit comments