@@ -32,6 +32,9 @@ def setup_network(self):
3232 def get_vsize (self , txn ):
3333 return self .nodes [0 ].decoderawtransaction (txn )['size' ]
3434
35+ def check_wallet_processed_blocks (self , nodeid , walletinfo ):
36+ assert_equal (self .nodes [nodeid ].getblockcount (), walletinfo ['last_processed_block' ])
37+
3538 def run_test (self ):
3639 # Check that there's no UTXO on none of the nodes
3740 assert_equal (len (self .nodes [0 ].listunspent ()), 0 )
@@ -43,6 +46,7 @@ def run_test(self):
4346 self .nodes [0 ].generate (1 )
4447
4548 walletinfo = self .nodes [0 ].getwalletinfo ()
49+ self .check_wallet_processed_blocks (0 , walletinfo )
4650 assert_equal (walletinfo ['immature_balance' ], 250 )
4751 assert_equal (walletinfo ['balance' ], 0 )
4852
@@ -54,13 +58,17 @@ def run_test(self):
5458 assert_equal (self .nodes [1 ].getbalance (), 250 )
5559 assert_equal (self .nodes [2 ].getbalance (), 0 )
5660
61+ walletinfo = self .nodes [0 ].getwalletinfo ()
62+ self .check_wallet_processed_blocks (0 , walletinfo )
63+ self .check_wallet_processed_blocks (1 , self .nodes [1 ].getwalletinfo ())
64+ self .check_wallet_processed_blocks (2 , self .nodes [2 ].getwalletinfo ())
65+
5766 # Check that only first and second nodes have UTXOs
5867 utxos = self .nodes [0 ].listunspent ()
5968 assert_equal (len (utxos ), 1 )
6069 assert_equal (len (self .nodes [1 ].listunspent ()), 1 )
6170 assert_equal (len (self .nodes [2 ].listunspent ()), 0 )
6271
63- walletinfo = self .nodes [0 ].getwalletinfo ()
6472 assert_equal (walletinfo ['immature_balance' ], 0 )
6573
6674 # Exercise locking of unspent outputs
@@ -185,6 +193,7 @@ def run_test(self):
185193 assert_equal (balance_nodes , [self .nodes [i ].getbalance () for i in range (3 )])
186194
187195 # Exercise listsinceblock with the last two blocks
196+ self .check_wallet_processed_blocks (0 , self .nodes [0 ].getwalletinfo ())
188197 coinbase_tx_1 = self .nodes [0 ].listsinceblock (blocks [0 ])
189198 assert_equal (coinbase_tx_1 ["lastblock" ], blocks [1 ])
190199 assert_equal (len (coinbase_tx_1 ["transactions" ]), 1 )
0 commit comments