diff --git a/test/functional/abc-parkedchain.py b/test/functional/abc-parkedchain.py --- a/test/functional/abc-parkedchain.py +++ b/test/functional/abc-parkedchain.py @@ -41,12 +41,9 @@ tip = node.getbestblockhash() self.generate(node, 1, sync_fun=self.no_op) block_to_park = node.getbestblockhash() - self.generate(node, 10, sync_fun=self.no_op) + self.generate(node, 10) parked_tip = node.getbestblockhash() - # Get parking_node caught up. - wait_for_tip(parking_node, parked_tip) - # Let's park the chain. assert parked_tip != tip assert block_to_park != tip @@ -68,12 +65,9 @@ bad_tip = node.getbestblockhash() # Generate an extra block to check that children are invalidated as # expected and do not produce dangling chaintips - self.generate(node, 1, sync_fun=self.no_op) + self.generate(node, 1) good_tip = node.getbestblockhash() - # avoid race condition from parking_node requesting block when invalid - wait_for_tip(parking_node, good_tip) - node.invalidateblock(bad_tip) self.only_valid_tip(tip, other_tip_status="invalid") node.parkblock(bad_tip) @@ -88,12 +82,9 @@ tip = node.getbestblockhash() self.generate(node, 1, sync_fun=self.no_op) bad_tip = node.getbestblockhash() - self.generate(node, 1, sync_fun=self.no_op) + self.generate(node, 1) good_tip = node.getbestblockhash() - # avoid race condition from parking_node requesting block when invalid - wait_for_tip(parking_node, good_tip) - node.parkblock(bad_tip) self.only_valid_tip(tip, other_tip_status="parked") node.invalidateblock(bad_tip) @@ -111,12 +102,9 @@ tip = node.getbestblockhash() self.generate(node, 1, sync_fun=self.no_op) bad_tip = node.getbestblockhash() - self.generate(node, 1, sync_fun=self.no_op) + self.generate(node, 1) good_tip = node.getbestblockhash() - # avoid race condition from parking_node requesting block when invalid - wait_for_tip(parking_node, good_tip) - node.invalidateblock(bad_tip) self.only_valid_tip(tip, other_tip_status="invalid") node.parkblock(bad_tip) @@ -131,12 +119,9 @@ tip = node.getbestblockhash() self.generate(node, 1, sync_fun=self.no_op) bad_tip = node.getbestblockhash() - self.generate(node, 1, sync_fun=self.no_op) + self.generate(node, 1) good_tip = node.getbestblockhash() - # avoid race condition from parking_node requesting block when invalid - wait_for_tip(parking_node, good_tip) - node.parkblock(bad_tip) self.only_valid_tip(tip, other_tip_status="parked") node.invalidateblock(bad_tip) diff --git a/test/functional/abc_p2p_avalanche_peer_discovery.py b/test/functional/abc_p2p_avalanche_peer_discovery.py --- a/test/functional/abc_p2p_avalanche_peer_discovery.py +++ b/test/functional/abc_p2p_avalanche_peer_discovery.py @@ -301,7 +301,6 @@ # D9697 is landed. forked_tip = self.generatetoaddress( node, 1, ADDRESS_ECREG_UNSPENDABLE, sync_fun=self.no_op)[0] - self.wait_until(lambda: node.getbestblockhash() == forked_tip) self.wait_until(lambda: len(node.getavalanchepeerinfo()) == 1) assert peer_proofid not in get_proof_ids(node) diff --git a/test/functional/feature_coinstatsindex.py b/test/functional/feature_coinstatsindex.py --- a/test/functional/feature_coinstatsindex.py +++ b/test/functional/feature_coinstatsindex.py @@ -67,8 +67,6 @@ subtractfeefromamount=True) self.generate(node, 1) - self.sync_blocks(timeout=120) - self.log.info( "Test that gettxoutsetinfo() output is consistent with or without coinstatsindex option") self.wait_until(lambda: not try_rpc(-32603, @@ -185,7 +183,6 @@ # Include both txs in a block self.generate(self.nodes[0], 1) - self.sync_all() self.wait_until(lambda: not try_rpc(-32603, "Unable to read UTXO set", index_node.gettxoutsetinfo, 'muhash')) diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py --- a/test/functional/interface_rest.py +++ b/test/functional/interface_rest.py @@ -84,9 +84,7 @@ not_related_address = "2MxqoHEdNQTyYeX1mHcbrrpzgojbosTpCvJ" self.generate(self.nodes[0], 1) - self.sync_all() self.generatetoaddress(self.nodes[1], 100, not_related_address) - self.sync_all() assert_equal(self.nodes[0].getbalance(), 50000000) @@ -115,7 +113,6 @@ self.log.info("Query an unspent TXO using the /getutxos URI") self.generatetoaddress(self.nodes[1], 1, not_related_address) - self.sync_all() bb_hash = self.nodes[0].getbestblockhash() assert_equal(self.nodes[1].getbalance(), Decimal("100000")) @@ -201,7 +198,6 @@ assert_equal(len(json_obj['utxos']), 0) self.generate(self.nodes[0], 1) - self.sync_all() json_obj = self.test_rest_request("/getutxos/{}-{}".format(*spending)) assert_equal(len(json_obj['utxos']), 1) @@ -228,9 +224,7 @@ "/getutxos/checkmempool/{}".format(long_uri), http_method='POST', status=200) # Generate block to not affect upcoming tests - self.generate(self.nodes[0], - 1) - self.sync_all() + self.generate(self.nodes[0], 1) self.log.info("Test the /block, /blockhashbyheight and /headers URIs") bb_hash = self.nodes[0].getbestblockhash() @@ -348,7 +342,6 @@ # See if we can get 5 headers in one response self.generate(self.nodes[1], 5) - self.sync_all() json_obj = self.test_rest_request("/headers/5/{}".format(bb_hash)) # Now we should have 5 header objects assert_equal(len(json_obj), 5) @@ -378,7 +371,6 @@ # Now mine the transactions newblockhash = self.generate(self.nodes[1], 1) - self.sync_all() # Check if the 3 tx show up in the new block json_obj = self.test_rest_request("/block/{}".format(newblockhash[0])) diff --git a/test/functional/interface_zmq.py b/test/functional/interface_zmq.py --- a/test/functional/interface_zmq.py +++ b/test/functional/interface_zmq.py @@ -192,8 +192,6 @@ genhashes = self.generatetoaddress(self.nodes[0], num_blocks, ADDRESS_ECREG_UNSPENDABLE) - self.sync_all() - for x in range(num_blocks): # Should receive the coinbase txid. txid = hashtx.receive() @@ -428,7 +426,6 @@ mempool_size = len(self.nodes[0].getrawmempool()) c_block = self.generatetoaddress(self.nodes[0], 1, ADDRESS_ECREG_UNSPENDABLE)[0] - self.sync_all() # Make sure the number of mined transactions matches the number of # txs out of mempool mempool_size_delta = mempool_size - \ @@ -484,7 +481,6 @@ # don't test for them currently self.nodes[0].reconsiderblock(best_hash) self.generatetoaddress(self.nodes[1], 1, ADDRESS_ECREG_UNSPENDABLE) - self.sync_all() self.log.info("Evict mempool transaction by block conflict") orig_txid = self.nodes[0].sendtoaddress( diff --git a/test/functional/mempool_packages.py b/test/functional/mempool_packages.py --- a/test/functional/mempool_packages.py +++ b/test/functional/mempool_packages.py @@ -220,7 +220,6 @@ # Check that prioritising a tx before it's added to the mempool works # First clear the mempool by mining a block. self.generate(self.nodes[0], 1) - self.sync_blocks() assert_equal(len(self.nodes[0].getrawmempool()), 0) # Prioritise a transaction that has been mined, then add it back to the # mempool by using invalidateblock. @@ -310,7 +309,6 @@ # Test reorg handling # First, the basics: self.generate(self.nodes[0], 1) - self.sync_blocks() self.nodes[1].invalidateblock(self.nodes[0].getbestblockhash()) self.nodes[1].reconsiderblock(self.nodes[0].getbestblockhash()) @@ -359,7 +357,6 @@ # Mine these in a block self.generate(self.nodes[0], 1) - self.sync_all() # Now generate tx8, with a big fee inputs = [{'txid': tx1_id, 'vout': 0}, {'txid': txid, 'vout': 0}] diff --git a/test/functional/mining_getblocktemplate_longpoll.py b/test/functional/mining_getblocktemplate_longpoll.py --- a/test/functional/mining_getblocktemplate_longpoll.py +++ b/test/functional/mining_getblocktemplate_longpoll.py @@ -78,7 +78,6 @@ # Add enough mature utxos to the wallets, so that all txs spend # confirmed coins self.generate(self.nodes[0], 100) - self.sync_blocks() self.log.info( "Test that introducing a new transaction into the mempool will terminate the longpoll") diff --git a/test/functional/p2p_blockfilters.py b/test/functional/p2p_blockfilters.py --- a/test/functional/p2p_blockfilters.py +++ b/test/functional/p2p_blockfilters.py @@ -56,7 +56,6 @@ # Nodes 0 & 1 share the same first 999 blocks in the chain. self.generate(self.nodes[0], 999) - self.sync_blocks(timeout=600) # Stale blocks by disconnecting nodes 0 & 1, mining, then reconnecting self.disconnect_nodes(0, 1) diff --git a/test/functional/p2p_ibd_txrelay.py b/test/functional/p2p_ibd_txrelay.py --- a/test/functional/p2p_ibd_txrelay.py +++ b/test/functional/p2p_ibd_txrelay.py @@ -32,7 +32,6 @@ # Come out of IBD by generating a block self.generate(self.nodes[0], 1) - self.sync_all() self.log.info( "Check that nodes reset minfilter after coming out of IBD") diff --git a/test/functional/p2p_permissions.py b/test/functional/p2p_permissions.py --- a/test/functional/p2p_permissions.py +++ b/test/functional/p2p_permissions.py @@ -137,7 +137,6 @@ def check_tx_relay(self): block_op_true = self.nodes[0].getblock( self.generatetoaddress(self.nodes[0], 100, ADDRESS_ECREG_P2SH_OP_TRUE)[0]) - self.sync_all() self.log.debug( "Create a connection from a forcerelay peer that rebroadcasts raw txs") diff --git a/test/functional/p2p_sendheaders.py b/test/functional/p2p_sendheaders.py --- a/test/functional/p2p_sendheaders.py +++ b/test/functional/p2p_sendheaders.py @@ -218,7 +218,6 @@ # make sure all invalidated blocks are node0's self.generatetoaddress(self.nodes[0], length, self.nodes[0].get_deterministic_priv_key().address) - self.sync_blocks(self.nodes, wait=0.1) for x in self.nodes[0].p2ps: x.wait_for_block_announcement( int(self.nodes[0].getbestblockhash(), 16)) @@ -231,7 +230,6 @@ # Must be longer than the orig chain all_hashes = self.generatetoaddress(self.nodes[1], length + 1, self.nodes[1].get_deterministic_priv_key().address) - self.sync_blocks(self.nodes, wait=0.1) return [int(x, 16) for x in all_hashes] def run_test(self): diff --git a/test/functional/rpc_createmultisig.py b/test/functional/rpc_createmultisig.py --- a/test/functional/rpc_createmultisig.py +++ b/test/functional/rpc_createmultisig.py @@ -43,7 +43,6 @@ self.log.info('Generating blocks ...') self.generate(node0, 149) - self.sync_all() self.moved = 0 for self.nkeys in [3, 5]: @@ -113,7 +112,6 @@ def checkbalances(self): node0, node1, node2 = self.nodes self.generate(node0, 100) - self.sync_all() bal0 = node0.getbalance() bal1 = node1.getbalance() diff --git a/test/functional/rpc_fundrawtransaction.py b/test/functional/rpc_fundrawtransaction.py --- a/test/functional/rpc_fundrawtransaction.py +++ b/test/functional/rpc_fundrawtransaction.py @@ -62,9 +62,7 @@ self.fee_tolerance = 2 * self.min_relay_tx_fee / 1000 self.generate(self.nodes[2], 1) - self.sync_all() self.generate(self.nodes[0], 121) - self.sync_all() self.test_change_position() self.test_simple() @@ -132,7 +130,6 @@ self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 5000000) self.generate(self.nodes[0], 1) - self.sync_all() wwatch.unloadwallet() @@ -532,7 +529,6 @@ # Send 1,200,000 XEC to msig addr. self.nodes[0].sendtoaddress(mSigObj, 1200000) self.generate(self.nodes[0], 1) - self.sync_all() oldBalance = self.nodes[1].getbalance() inputs = [] @@ -545,7 +541,6 @@ final_psbt = w2.finalizepsbt(signed_psbt['psbt']) self.nodes[2].sendrawtransaction(final_psbt['hex']) self.generate(self.nodes[2], 1) - self.sync_all() # Make sure funds are received at node1. assert_equal( @@ -615,7 +610,6 @@ signedTx = self.nodes[1].signrawtransactionwithwallet(fundedTx['hex']) self.nodes[1].sendrawtransaction(signedTx['hex']) self.generate(self.nodes[1], 1) - self.sync_all() # Make sure funds are received at node1. assert_equal( @@ -629,12 +623,10 @@ self.nodes[1].sendtoaddress( self.nodes[0].getnewaddress(), self.nodes[1].getbalance(), "", "", True) self.generate(self.nodes[1], 1) - self.sync_all() for _ in range(20): self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 10000) self.generate(self.nodes[0], 1) - self.sync_all() # Fund a tx with ~20 small inputs. inputs = [] @@ -660,12 +652,10 @@ self.nodes[1].sendtoaddress( self.nodes[0].getnewaddress(), self.nodes[1].getbalance(), "", "", True) self.generate(self.nodes[1], 1) - self.sync_all() for _ in range(20): self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 10000) self.generate(self.nodes[0], 1) - self.sync_all() # Fund a tx with ~20 small inputs. oldBalance = self.nodes[0].getbalance() @@ -679,7 +669,6 @@ fundedTx['hex']) self.nodes[1].sendrawtransaction(fundedAndSignedTx['hex']) self.generate(self.nodes[1], 1) - self.sync_all() assert_equal(oldBalance + Decimal('50190000.00'), self.nodes[0].getbalance()) # 0.19+block reward @@ -765,7 +754,6 @@ assert signedtx["complete"] self.nodes[0].sendrawtransaction(signedtx["hex"]) self.generate(self.nodes[0], 1) - self.sync_all() wwatch.unloadwallet() diff --git a/test/functional/rpc_getblockstats.py b/test/functional/rpc_getblockstats.py --- a/test/functional/rpc_getblockstats.py +++ b/test/functional/rpc_getblockstats.py @@ -58,7 +58,6 @@ amount=10000000, subtractfeefromamount=True) self.generate(self.nodes[0], 1) - self.sync_all() self.nodes[0].sendtoaddress( address=address, diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py --- a/test/functional/rpc_psbt.py +++ b/test/functional/rpc_psbt.py @@ -94,7 +94,6 @@ 'hex'] txid = self.nodes[0].sendrawtransaction(signed_tx) self.generate(self.nodes[0], 6) - self.sync_all() # Find the output pos p2sh_pos = -1 @@ -194,7 +193,6 @@ txid1 = self.nodes[0].sendtoaddress(node1_addr, 13000000) txid2 = self.nodes[0].sendtoaddress(node2_addr, 13000000) blockhash = self.generate(self.nodes[0], 6)[0] - self.sync_all() vout1 = find_output( self.nodes[1], txid1, @@ -233,7 +231,6 @@ finalized = self.nodes[0].finalizepsbt(combined)['hex'] self.nodes[0].sendrawtransaction(finalized) self.generate(self.nodes[0], 6) - self.sync_all() block_height = self.nodes[0].getblockcount() unspent = self.nodes[0].listunspent()[0] @@ -383,7 +380,6 @@ txid4 = self.nodes[0].sendtoaddress(addr4, 5000000) vout4 = find_output(self.nodes[0], txid4, 5000000) self.generate(self.nodes[0], 6) - self.sync_all() psbt2 = self.nodes[1].createpsbt([{"txid": txid4, "vout": vout4}], { self.nodes[0].getnewaddress(): Decimal('4999000')}) psbt2 = self.nodes[1].walletprocesspsbt(psbt2)['psbt'] @@ -414,7 +410,6 @@ addr = self.nodes[1].getnewaddress("") txid = self.nodes[0].sendtoaddress(addr, 7000000) blockhash = self.generate(self.nodes[0], 6)[0] - self.sync_all() vout = find_output(self.nodes[0], txid, 7000000, blockhash=blockhash) psbt = self.nodes[1].createpsbt([{"txid": txid, "vout": vout}], { self.nodes[0].getnewaddress(""): Decimal('6999000')}) diff --git a/test/functional/rpc_rawtransaction.py b/test/functional/rpc_rawtransaction.py --- a/test/functional/rpc_rawtransaction.py +++ b/test/functional/rpc_rawtransaction.py @@ -73,15 +73,12 @@ self.log.info( 'prepare some coins for multiple *rawtransaction commands') self.generate(self.nodes[2], 1) - self.sync_all() self.generate(self.nodes[0], 101) - self.sync_all() self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 1500000) self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 1000000) self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 5000000) self.sync_all() self.generate(self.nodes[0], 5) - self.sync_all() self.log.info( 'Test getrawtransaction on genesis block coinbase returns an error') diff --git a/test/functional/rpc_txoutproof.py b/test/functional/rpc_txoutproof.py --- a/test/functional/rpc_txoutproof.py +++ b/test/functional/rpc_txoutproof.py @@ -25,7 +25,6 @@ # confirmed coins self.generate(miniwallet, 5) self.generate(self.nodes[0], 100) - self.sync_all() chain_height = self.nodes[1].getblockcount() assert_equal(chain_height, 105) @@ -59,7 +58,6 @@ utxo_to_spend=txin_spent) txid3 = tx3['txid'] self.generate(self.nodes[0], 1) - self.sync_all() txid_spent = txin_spent["txid"] txid_unspent = txid1 # Input was change from txid2, so txid1 should be unspent diff --git a/test/functional/wallet_abandonconflict.py b/test/functional/wallet_abandonconflict.py --- a/test/functional/wallet_abandonconflict.py +++ b/test/functional/wallet_abandonconflict.py @@ -40,7 +40,6 @@ return satoshi_round(total) self.generate(self.nodes[1], 100) - self.sync_blocks() balance = self.nodes[0].getbalance() txA = self.nodes[0].sendtoaddress( self.nodes[0].getnewaddress(), Decimal("10000000")) diff --git a/test/functional/wallet_address_types.py b/test/functional/wallet_address_types.py --- a/test/functional/wallet_address_types.py +++ b/test/functional/wallet_address_types.py @@ -168,7 +168,6 @@ # Mine 101 blocks on node4 to bring nodes out of IBD and make sure that # no coinbases are maturing for the nodes-under-test during the test self.generate(self.nodes[4], 101) - self.sync_blocks() uncompressed_1 = "0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee" uncompressed_2 = "047211a824f55b505228e4c3d5194c1fcfaa15a456abdf37f9b9d97a4040afc073dee6c89064984f03385237d92167c13e236446b417ab79a0fcae412ae3316b77" @@ -263,7 +262,6 @@ # node4 collects fee and block subsidy to keep accounting simple self.generate(self.nodes[4], 1) - self.sync_blocks() # Verify that the receiving wallet contains a UTXO with the # expected address, and expected descriptor diff --git a/test/functional/wallet_avoidreuse.py b/test/functional/wallet_avoidreuse.py --- a/test/functional/wallet_avoidreuse.py +++ b/test/functional/wallet_avoidreuse.py @@ -90,7 +90,6 @@ self.test_immutable() self.generate(self.nodes[0], 110) - self.sync_all() self.test_change_remains_change(self.nodes[1]) reset_balance(self.nodes[1], self.nodes[0].getnewaddress()) self.test_sending_from_reused_address_without_avoid_reuse() @@ -203,7 +202,6 @@ self.nodes[0].sendtoaddress(fundaddr, 10000000) self.generate(self.nodes[0], 1) - self.sync_all() # listunspent should show 1 single, unused 10MM XEC output assert_unspent( @@ -220,7 +218,6 @@ self.nodes[1].sendtoaddress(retaddr, 5000000) self.generate(self.nodes[0], 1) - self.sync_all() # listunspent should show 1 single, unused 5MM XEC output assert_unspent( @@ -234,7 +231,6 @@ self.nodes[0].sendtoaddress(fundaddr, 10000000) self.generate(self.nodes[0], 1) - self.sync_all() # listunspent should show 2 total outputs (5MM, 10MM XEC), one unused # (5MM), one reused (10MM) @@ -287,7 +283,6 @@ self.nodes[0].sendtoaddress(fundaddr, 10000000) self.generate(self.nodes[0], 1) - self.sync_all() # listunspent should show 1 single, unused 10MM XEC output assert_unspent( @@ -301,7 +296,6 @@ self.nodes[1].sendtoaddress(retaddr, 5000000) self.generate(self.nodes[0], 1) - self.sync_all() # listunspent should show 1 single, unused 5MM XEC output assert_unspent( @@ -322,7 +316,6 @@ self.nodes[0].sendtoaddress(new_fundaddr, 10000000) self.generate(self.nodes[0], 1) - self.sync_all() # listunspent should show 2 total outputs (5MM, 10MM XEC), one unused # (5MM), one reused (10MM) @@ -396,7 +389,6 @@ self.nodes[0].sendtoaddress(new_addr, 1000000) self.generate(self.nodes[0], 1) - self.sync_all() # send transaction that should not use all the available outputs # per the current coin selection algorithm @@ -438,7 +430,6 @@ self.nodes[0].sendtoaddress(new_addr, 1000000) self.generate(self.nodes[0], 1) - self.sync_all() # Sending a transaction that is smaller than each one of the # available outputs @@ -467,7 +458,6 @@ self.nodes[0].sendtoaddress(new_addr, 1000000) self.generate(self.nodes[0], 1) - self.sync_all() # Sending a transaction that needs to use the full groups # of 10 inputs but also the incomplete group of 2 inputs. diff --git a/test/functional/wallet_backup.py b/test/functional/wallet_backup.py --- a/test/functional/wallet_backup.py +++ b/test/functional/wallet_backup.py @@ -85,7 +85,6 @@ # Must sync mempools before mining. self.sync_mempools() self.generate(self.nodes[3], 1) - self.sync_blocks() # As above, this mirrors the original bash test. def start_three(self): @@ -116,13 +115,9 @@ def run_test(self): self.log.info("Generating initial blockchain") self.generate(self.nodes[0], 1) - self.sync_blocks() self.generate(self.nodes[1], 1) - self.sync_blocks() self.generate(self.nodes[2], 1) - self.sync_blocks() self.generate(self.nodes[3], 100) - self.sync_blocks() assert_equal(self.nodes[0].getbalance(), 50000000) assert_equal(self.nodes[1].getbalance(), 50000000) @@ -154,7 +149,6 @@ # Generate 101 more blocks, so any fees paid mature self.generate(self.nodes[3], 101) - self.sync_all() balance0 = self.nodes[0].getbalance() balance1 = self.nodes[1].getbalance() diff --git a/test/functional/wallet_balance.py b/test/functional/wallet_balance.py --- a/test/functional/wallet_balance.py +++ b/test/functional/wallet_balance.py @@ -76,10 +76,8 @@ 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], 101, ADDRESS_WATCHONLY) - self.sync_all() if not self.options.descriptors: # Tests legacy watchonly behavior which is not present (and does not @@ -240,7 +238,6 @@ test_balances(fee_node_1=Decimal('10000')) self.generatetoaddress(self.nodes[1], 1, ADDRESS_WATCHONLY) - self.sync_all() # balances are correct after the transactions are confirmed # node 1's send plus change from node 0's send @@ -259,7 +256,6 @@ ), Decimal('29970000'), [Decimal('10000')]) 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 @@ -310,7 +306,6 @@ # 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)') @@ -332,7 +327,6 @@ self.sync_blocks() self.nodes[1].sendrawtransaction(tx_orig) self.generatetoaddress(self.nodes[1], 1, ADDRESS_WATCHONLY) - self.sync_all() # The reorg recovered our fee of 1 coin assert_equal( self.nodes[0].getbalance( diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py --- a/test/functional/wallet_basic.py +++ b/test/functional/wallet_basic.py @@ -278,7 +278,6 @@ self.sync_all() self.generate(self.nodes[1], 1) # mine a block - self.sync_all() # zero value tx must be in listunspents output unspent_txs = self.nodes[0].listunspent() diff --git a/test/functional/wallet_groups.py b/test/functional/wallet_groups.py --- a/test/functional/wallet_groups.py +++ b/test/functional/wallet_groups.py @@ -47,7 +47,6 @@ [self.nodes[0].sendtoaddress(addr, 500000) for addr in addrs] self.generate(self.nodes[0], 1) - self.sync_all() # For each node, send 0.2 coins back to 0; # - node[1] should pick one 0.5 UTXO and leave the rest @@ -115,7 +114,6 @@ self.nodes[0].sendtoaddress(addr_aps, 1000000) self.nodes[0].sendtoaddress(addr_aps, 1000000) self.generate(self.nodes[0], 1) - self.sync_all() with self.nodes[3].assert_debug_log([ 'Fee non-grouped = 225, grouped = 372, using grouped']): txid4 = self.nodes[3].sendtoaddress( @@ -129,7 +127,6 @@ addr_aps2 = self.nodes[3].getnewaddress() [self.nodes[0].sendtoaddress(addr_aps2, 1_000_000) for _ in range(5)] self.generate(self.nodes[0], 1) - self.sync_all() with self.nodes[3].assert_debug_log([ 'Fee non-grouped = 519, grouped = 813, using non-grouped']): txid5 = self.nodes[3].sendtoaddress(self.nodes[0].getnewaddress(), @@ -144,7 +141,6 @@ addr_aps3 = self.nodes[4].getnewaddress() [self.nodes[0].sendtoaddress(addr_aps3, 1_000_000) for _ in range(5)] self.generate(self.nodes[0], 1) - self.sync_all() with self.nodes[4].assert_debug_log([ 'Fee non-grouped = 519, grouped = 813, using grouped']): txid6 = self.nodes[4].sendtoaddress(self.nodes[0].getnewaddress(), @@ -174,8 +170,6 @@ self.nodes[0].sendrawtransaction(signed_tx['hex']) self.generate(self.nodes[0], 1) - self.sync_all() - # Check that we can create a transaction that only requires ~100 of our # utxos, without pulling in all outputs and creating a transaction that # is way too big. diff --git a/test/functional/wallet_hd.py b/test/functional/wallet_hd.py --- a/test/functional/wallet_hd.py +++ b/test/functional/wallet_hd.py @@ -290,7 +290,6 @@ origin_rpc.sendrawtransaction( self.nodes[0].gettransaction(txid)['hex']) self.generate(self.nodes[0], 1) - self.sync_blocks() origin_rpc.gettransaction(txid) assert_raises_rpc_error(-5, 'Invalid or non-wallet transaction id', @@ -307,7 +306,6 @@ origin_rpc.sendrawtransaction( self.nodes[0].gettransaction(txid)['hex']) self.generate(self.nodes[0], 1) - self.sync_blocks() origin_rpc.gettransaction(txid) restore_rpc.gettransaction(txid) assert_raises_rpc_error(-5, diff --git a/test/functional/wallet_import_rescan.py b/test/functional/wallet_import_rescan.py --- a/test/functional/wallet_import_rescan.py +++ b/test/functional/wallet_import_rescan.py @@ -190,7 +190,6 @@ set_node_times(self.nodes, self.nodes[0].getblockheader( self.nodes[0].getbestblockhash())["time"] + TIMESTAMP_WINDOW + 1) self.generate(self.nodes[0], 1) - self.sync_all() # For each variation of wallet key import, invoke the import RPC and # check the results from getbalance and listtransactions. diff --git a/test/functional/wallet_importdescriptors.py b/test/functional/wallet_importdescriptors.py --- a/test/functional/wallet_importdescriptors.py +++ b/test/functional/wallet_importdescriptors.py @@ -306,7 +306,6 @@ ismine=True) txid = w0.sendtoaddress(address, 49999996.00) self.generatetoaddress(self.nodes[0], 6, w0.getnewaddress()) - self.sync_blocks() tx = wpriv.createrawtransaction([{"txid": txid, "vout": 0}], { w0.getnewaddress(): 49999000}) signed_tx = wpriv.signrawtransactionwithwallet(tx) @@ -354,7 +353,6 @@ assert_equal(wmulti_priv.getwalletinfo()['keypoolsize'], 1000) txid = w0.sendtoaddress(addr, 10000000) self.generate(self.nodes[0], 6) - self.sync_all() self.nodes[1].createwallet( wallet_name="wmulti_pub", @@ -397,7 +395,6 @@ txid = w0.sendtoaddress(addr, 10000000) vout = find_vout_for_address(self.nodes[0], txid, addr) self.generate(self.nodes[0], 6) - self.sync_all() assert_equal(wmulti_pub.getbalance(), wmulti_priv.getbalance()) # Make sure that descriptor wallets containing multiple xpubs in a diff --git a/test/functional/wallet_importprunedfunds.py b/test/functional/wallet_importprunedfunds.py --- a/test/functional/wallet_importprunedfunds.py +++ b/test/functional/wallet_importprunedfunds.py @@ -25,8 +25,6 @@ self.log.info("Mining blocks...") self.generate(self.nodes[0], 101) - self.sync_all() - # address address1 = self.nodes[0].getnewaddress() # pubkey diff --git a/test/functional/wallet_keypool_topup.py b/test/functional/wallet_keypool_topup.py --- a/test/functional/wallet_keypool_topup.py +++ b/test/functional/wallet_keypool_topup.py @@ -50,7 +50,6 @@ self.generate(self.nodes[0], 1) self.nodes[0].sendtoaddress(addr_extpool, 5000000) self.generate(self.nodes[0], 1) - self.sync_blocks() self.log.info("Restart node with wallet backup") self.stop_node(1) diff --git a/test/functional/wallet_listreceivedby.py b/test/functional/wallet_listreceivedby.py --- a/test/functional/wallet_listreceivedby.py +++ b/test/functional/wallet_listreceivedby.py @@ -28,7 +28,6 @@ def run_test(self): # Generate block to get out of IBD self.generate(self.nodes[0], 1) - self.sync_blocks() # save the number of coinbase reward addresses so far num_cb_reward_addresses = len( @@ -52,7 +51,6 @@ # Bury Tx under 10 block so it will be returned by # listreceivedbyaddress self.generate(self.nodes[1], 10) - self.sync_all() assert_array_result(self.nodes[1].listreceivedbyaddress(), {"address": addr}, {"address": addr, "label": "", "amount": Decimal("100000"), "confirmations": 10, "txids": [txid, ]}) @@ -92,7 +90,6 @@ other_addr = self.nodes[1].getnewaddress() txid2 = self.nodes[0].sendtoaddress(other_addr, 100000) self.generate(self.nodes[0], 1) - self.sync_all() # Same test as above should still pass expected = {"address": addr, "label": "", "amount": Decimal( "100000"), "confirmations": 11, "txids": [txid, ]} @@ -134,7 +131,6 @@ # Bury Tx under 10 block so it will be returned by the default # getreceivedbyaddress self.generate(self.nodes[1], 10) - self.sync_all() balance = self.nodes[1].getreceivedbyaddress(addr) assert_equal(balance, Decimal("100000")) @@ -168,7 +164,6 @@ assert_equal(balance, balance_by_label) self.generate(self.nodes[1], 10) - self.sync_all() # listreceivedbylabel should return updated received list assert_array_result(self.nodes[1].listreceivedbylabel(), {"label": label}, diff --git a/test/functional/wallet_listsinceblock.py b/test/functional/wallet_listsinceblock.py --- a/test/functional/wallet_listsinceblock.py +++ b/test/functional/wallet_listsinceblock.py @@ -33,7 +33,6 @@ # only one connection. (See fPreferredDownload in net_processing) self.connect_nodes(1, 2) self.generate(self.nodes[2], 101) - self.sync_all() self.test_no_blockhash() self.test_invalid_blockhash() @@ -199,7 +198,6 @@ hash160(eckey.get_pubkey().get_bytes())) self.nodes[2].sendtoaddress(address, 10_000_000) self.generate(self.nodes[2], 6) - self.sync_all() self.nodes[2].importprivkey(privkey) utxos = self.nodes[2].listunspent() utxo = [u for u in utxos if u["address"] == address][0] diff --git a/test/functional/wallet_listtransactions.py b/test/functional/wallet_listtransactions.py --- a/test/functional/wallet_listtransactions.py +++ b/test/functional/wallet_listtransactions.py @@ -99,7 +99,6 @@ multisig["redeemScript"], "watchonly", False, True) txid = self.nodes[1].sendtoaddress(multisig["address"], 100000) self.generate(self.nodes[1], 1) - self.sync_all() assert_equal(len(self.nodes[0].listtransactions( label="watchonly", include_watchonly=True)), 1) assert_equal(len(self.nodes[0].listtransactions( diff --git a/test/functional/wallet_reorgsrestore.py b/test/functional/wallet_reorgsrestore.py --- a/test/functional/wallet_reorgsrestore.py +++ b/test/functional/wallet_reorgsrestore.py @@ -34,7 +34,6 @@ txid_conflict_from = self.nodes[0].sendtoaddress( self.nodes[0].getnewaddress(), Decimal("10000000")) self.generate(self.nodes[0], 1) - self.sync_blocks() # Disconnect node1 from others to reorg its chain later self.disconnect_nodes(0, 1) diff --git a/test/functional/wallet_send.py b/test/functional/wallet_send.py --- a/test/functional/wallet_send.py +++ b/test/functional/wallet_send.py @@ -201,7 +201,6 @@ # fund w3 w0.sendtoaddress(a2_receive, 10_000_000) self.generate(self.nodes[0], 1) - self.sync_blocks() # w4 has private keys enabled, but only contains watch-only keys (from # w2) @@ -222,7 +221,6 @@ # fund w4 w0.sendtoaddress(a2_receive, 10_000_000) self.generate(self.nodes[0], 1) - self.sync_blocks() self.log.info("Send to address...") self.test_send(from_wallet=w0, to_wallet=w1, amount=1_000_000) diff --git a/test/functional/wallet_txn_clone.py b/test/functional/wallet_txn_clone.py --- a/test/functional/wallet_txn_clone.py +++ b/test/functional/wallet_txn_clone.py @@ -122,7 +122,6 @@ self.nodes[2].sendrawtransaction(tx2["hex"]) # Mine another block to make sure we sync self.generate(self.nodes[2], 1) - self.sync_blocks() # Re-fetch transaction info: tx1 = self.nodes[0].gettransaction(txid1) diff --git a/test/functional/wallet_txn_doublespend.py b/test/functional/wallet_txn_doublespend.py --- a/test/functional/wallet_txn_doublespend.py +++ b/test/functional/wallet_txn_doublespend.py @@ -121,7 +121,6 @@ self.connect_nodes(1, 2) # Mine another block to make sure we sync self.generate(self.nodes[2], 1) - self.sync_blocks() assert_equal(self.nodes[0].gettransaction( doublespend_txid)["confirmations"], 2)