From fa974f1f1417a536636347072e86bcb54a4c909c Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Wed, 28 Jul 2021 12:12:50 +0200 Subject: scripted-diff: Remove redundant sync_all and sync_blocks The sync calls are redundant after a call to generate, because generate already syncs itself. -BEGIN VERIFY SCRIPT- perl -0777 -pi -e 's/(generate[^\n]*\)[^\n]*)(\n|\s)+self.sync_(all|blocks)\([^\)]*\)\n/\1\n/g' $(git grep -l generate ./test) -END VERIFY SCRIPT- --- test/functional/wallet_balance.py | 6 ------ 1 file changed, 6 deletions(-) (limited to 'test/functional/wallet_balance.py') diff --git a/test/functional/wallet_balance.py b/test/functional/wallet_balance.py index 470cd9f34c..a42c2632e3 100755 --- a/test/functional/wallet_balance.py +++ b/test/functional/wallet_balance.py @@ -71,10 +71,8 @@ class WalletTest(BitcoinTestFramework): self.log.info("Mining blocks ...") self.generate(self.nodes[0], 1) - self.sync_all() self.generate(self.nodes[1], 1) self.generatetoaddress(self.nodes[1], COINBASE_MATURITY + 1, ADDRESS_WATCHONLY) - self.sync_all() if not self.options.descriptors: # Tests legacy watchonly behavior which is not present (and does not need to be tested) in descriptor wallets @@ -197,7 +195,6 @@ class WalletTest(BitcoinTestFramework): test_balances(fee_node_1=Decimal('0.02')) self.generatetoaddress(self.nodes[1], 1, ADDRESS_WATCHONLY) - self.sync_all() # balances are correct after the transactions are confirmed balance_node0 = Decimal('69.99') # node 1's send plus change from node 0's send @@ -211,7 +208,6 @@ class WalletTest(BitcoinTestFramework): txs = create_transactions(self.nodes[1], self.nodes[0].getnewaddress(), Decimal('29.97'), [Decimal('0.01')]) self.nodes[1].sendrawtransaction(txs[0]['hex']) self.generatetoaddress(self.nodes[1], 2, ADDRESS_WATCHONLY) - self.sync_all() # getbalance with a minconf incorrectly excludes coins that have been spent more recently than the minconf blocks ago # TODO: fix getbalance tracking of coin spentness depth @@ -258,7 +254,6 @@ class WalletTest(BitcoinTestFramework): # Now confirm tx_replace block_reorg = self.generatetoaddress(self.nodes[1], 1, ADDRESS_WATCHONLY)[0] - self.sync_all() assert_equal(self.nodes[0].getbalance(minconf=0), total_amount) self.log.info('Put txs back into mempool of node 1 (not node 0)') @@ -274,7 +269,6 @@ class WalletTest(BitcoinTestFramework): self.sync_blocks() self.nodes[1].sendrawtransaction(tx_orig) self.generatetoaddress(self.nodes[1], 1, ADDRESS_WATCHONLY) - self.sync_all() assert_equal(self.nodes[0].getbalance(minconf=0), total_amount + 1) # The reorg recovered our fee of 1 coin -- cgit v1.2.3