diff --git a/test/functional/abc-segwit-recovery.py b/test/functional/abc-segwit-recovery.py --- a/test/functional/abc-segwit-recovery.py +++ b/test/functional/abc-segwit-recovery.py @@ -36,7 +36,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_raises_rpc_error, - sync_blocks, ) TEST_TIME = int(time.time()) @@ -246,7 +245,7 @@ accepted(node_nonstd) # Check both nodes are synchronized before continuing. - sync_blocks(self.nodes) + self.sync_blocks() # Check that upgraded nodes checking for standardness are not banning # nodes sending segwit spending txns. @@ -274,7 +273,7 @@ block(5) update_block(5, [txspend, txspend_case0]) accepted(node_nonstd) - sync_blocks(self.nodes) + self.sync_blocks() if __name__ == '__main__': diff --git a/test/functional/abc_p2p_avalanche.py b/test/functional/abc_p2p_avalanche.py --- a/test/functional/abc_p2p_avalanche.py +++ b/test/functional/abc_p2p_avalanche.py @@ -17,7 +17,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, - sync_blocks, wait_until, ) from test_framework import schnorr @@ -104,7 +103,7 @@ fork_node = self.nodes[1] # Make sure the fork node has synced the blocks - sync_blocks([node, fork_node]) + self.sync_blocks([node, fork_node]) # Get the key so we can verify signatures. avakey = bytes.fromhex(node.getavalanchekey()) @@ -184,7 +183,7 @@ node.addavalanchepeer(nodeid, pubkey.hex()) # Make sure the fork node has synced the blocks - sync_blocks([node, fork_node]) + self.sync_blocks([node, fork_node]) # Create a fork 2 blocks deep. This should trigger polling. fork_node.invalidateblock(fork_node.getblockhash(100)) diff --git a/test/functional/abc_wallet_standardness.py b/test/functional/abc_wallet_standardness.py --- a/test/functional/abc_wallet_standardness.py +++ b/test/functional/abc_wallet_standardness.py @@ -6,6 +6,12 @@ that it might try to spend.""" from decimal import Decimal +from test_framework.messages import ( + CTransaction, + CTxOut, + FromHex, + ToHex, +) from test_framework.script import ( CScript, OP_1, @@ -22,13 +28,6 @@ from test_framework.util import ( assert_raises_rpc_error, assert_equal, - sync_blocks, -) -from test_framework.messages import ( - CTransaction, - CTxOut, - FromHex, - ToHex, ) SATOSHI = Decimal('0.00000001') @@ -50,7 +49,7 @@ # make and mature some coins for the nonstandard node nonstd_node.generate(120) - sync_blocks(self.nodes) + self.sync_blocks() def fund_and_test_wallet(scriptPubKey, shouldBeStandard, shouldBeInWallet, amount=10000, spendfee=500, nonstd_error="scriptpubkey (code 64)", sign_error=None): @@ -96,7 +95,7 @@ # make sure it was mined assert txid in nonstd_node.getblock(blockhash)["tx"] - sync_blocks(self.nodes) + self.sync_blocks() wallet_outpoints = {(entry['txid'], entry['vout']) for entry in std_node.listunspent()} @@ -128,7 +127,7 @@ [blockhash] = std_node.generate(1) # make sure it was mined assert txid in std_node.getblock(blockhash)["tx"] - sync_blocks(self.nodes) + self.sync_blocks() else: assert_equal(signresult['complete'], False) assert_equal(signresult['errors'][0]['error'], sign_error) diff --git a/test/functional/feature_bip68_sequence.py b/test/functional/feature_bip68_sequence.py --- a/test/functional/feature_bip68_sequence.py +++ b/test/functional/feature_bip68_sequence.py @@ -29,7 +29,6 @@ connect_nodes, disconnect_nodes, satoshi_round, - sync_blocks, ) SEQUENCE_LOCKTIME_DISABLE_FLAG = (1 << 31) @@ -475,7 +474,7 @@ # the activation point, so we invalidate the tip. self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash()) connect_nodes(self.nodes[0], self.nodes[1]) - sync_blocks(self.nodes) + self.sync_blocks() # Use self.nodes[1] to test that version 2 transactions are standard. def test_version2_relay(self): diff --git a/test/functional/feature_pruning.py b/test/functional/feature_pruning.py --- a/test/functional/feature_pruning.py +++ b/test/functional/feature_pruning.py @@ -21,7 +21,6 @@ assert_raises_rpc_error, connect_nodes, disconnect_nodes, - sync_blocks, wait_until, ) @@ -120,7 +119,7 @@ connect_nodes(self.nodes[0], self.nodes[2]) connect_nodes(self.nodes[0], self.nodes[3]) connect_nodes(self.nodes[0], self.nodes[4]) - sync_blocks(self.nodes[0:5]) + self.sync_blocks(self.nodes[0:5]) def setup_nodes(self): self.add_nodes(self.num_nodes, self.extra_args) @@ -134,13 +133,13 @@ def create_big_chain(self): # Start by creating some coinbases we can spend later self.nodes[1].generate(200) - sync_blocks(self.nodes[0:2]) + self.sync_blocks(self.nodes[0:2]) self.nodes[0].generate(150) # Then mine enough full blocks to create more than 550MiB of data mine_large_blocks(self.nodes[0], 645) - sync_blocks(self.nodes[0:5]) + self.sync_blocks(self.nodes[0:5]) def test_height_min(self): assert os.path.isfile(os.path.join( @@ -184,7 +183,7 @@ # at the same time connect_nodes(self.nodes[0], self.nodes[1]) connect_nodes(self.nodes[0], self.nodes[2]) - sync_blocks(self.nodes[0:3]) + self.sync_blocks(self.nodes[0:3]) self.log.info("Usage can be over target because of high stale rate: {}".format( calc_usage(self.prunedir))) @@ -226,7 +225,7 @@ self.log.info("Reconnect nodes") connect_nodes(self.nodes[0], self.nodes[1]) connect_nodes(self.nodes[1], self.nodes[2]) - sync_blocks(self.nodes[0:3], timeout=120) + self.sync_blocks(self.nodes[0:3], timeout=120) self.log.info("Verify height on node 2: {}".format( self.nodes[2].getblockcount())) @@ -237,7 +236,7 @@ "Mine 220 more large blocks so we have requisite history") mine_large_blocks(self.nodes[0], 220) - sync_blocks(self.nodes[0:3], timeout=120) + self.sync_blocks(self.nodes[0:3], timeout=120) usage = calc_usage(self.prunedir) self.log.info("Usage should be below target: {}".format(usage)) @@ -410,7 +409,7 @@ self.log.info("Syncing node 5 to test wallet") connect_nodes(self.nodes[0], self.nodes[5]) nds = [self.nodes[0], self.nodes[5]] - sync_blocks(nds, wait=5, timeout=300) + self.sync_blocks(nds, wait=5, timeout=300) # Stop and start to trigger rescan self.stop_node(5) self.start_node( 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 @@ -12,8 +12,6 @@ assert_equal, assert_raises_rpc_error, satoshi_round, - sync_blocks, - sync_mempools, ) # TODO: The activation code can be reverted after the new policy becomes @@ -204,7 +202,7 @@ # Check that prioritising a tx before it's added to the mempool works # First clear the mempool by mining a block. self.nodes[0].generate(1) - sync_blocks(self.nodes) + 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. @@ -282,7 +280,7 @@ # Test reorg handling # First, the basics: self.nodes[0].generate(1) - sync_blocks(self.nodes) + self.sync_blocks() self.nodes[1].invalidateblock(self.nodes[0].getbestblockhash()) self.nodes[1].reconsiderblock(self.nodes[0].getbestblockhash()) @@ -339,12 +337,12 @@ rawtx = self.nodes[0].createrawtransaction(inputs, outputs) signedtx = self.nodes[0].signrawtransactionwithwallet(rawtx) txid = self.nodes[0].sendrawtransaction(signedtx['hex']) - sync_mempools(self.nodes) + self.sync_mempools() # Now try to disconnect the tip on each node... self.nodes[1].invalidateblock(self.nodes[1].getbestblockhash()) self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash()) - sync_blocks(self.nodes) + self.sync_blocks() if __name__ == '__main__': diff --git a/test/functional/p2p_compactblocks.py b/test/functional/p2p_compactblocks.py --- a/test/functional/p2p_compactblocks.py +++ b/test/functional/p2p_compactblocks.py @@ -47,7 +47,10 @@ from test_framework.script import CScript, OP_TRUE from test_framework.test_framework import BitcoinTestFramework from test_framework.txtools import pad_tx -from test_framework.util import assert_equal, sync_blocks, wait_until +from test_framework.util import ( + assert_equal, + wait_until, +) # TestP2PConn: A peer we use to send messages to bitcoind, and store responses. @@ -855,53 +858,53 @@ self.log.info("\tTesting SENDCMPCT p2p message... ") self.test_sendcmpct(self.nodes[0], self.test_node, 1) - sync_blocks(self.nodes) + self.sync_blocks() self.test_sendcmpct( self.nodes[1], self.ex_softfork_node, 1, old_node=self.old_node) - sync_blocks(self.nodes) + self.sync_blocks() self.log.info("\tTesting compactblock construction...") self.test_compactblock_construction(self.nodes[0], self.test_node) - sync_blocks(self.nodes) + self.sync_blocks() self.test_compactblock_construction( self.nodes[1], self.ex_softfork_node) - sync_blocks(self.nodes) + self.sync_blocks() self.log.info("\tTesting compactblock requests... ") self.test_compactblock_requests(self.nodes[0], self.test_node, 1) - sync_blocks(self.nodes) + self.sync_blocks() self.test_compactblock_requests( self.nodes[1], self.ex_softfork_node, 2) - sync_blocks(self.nodes) + self.sync_blocks() self.log.info("\tTesting getblocktxn requests...") self.test_getblocktxn_requests(self.nodes[0], self.test_node, 1) - sync_blocks(self.nodes) + self.sync_blocks() self.test_getblocktxn_requests(self.nodes[1], self.ex_softfork_node, 2) - sync_blocks(self.nodes) + self.sync_blocks() self.log.info("\tTesting getblocktxn handler...") self.test_getblocktxn_handler(self.nodes[0], self.test_node, 1) - sync_blocks(self.nodes) + self.sync_blocks() self.test_getblocktxn_handler(self.nodes[1], self.ex_softfork_node, 2) self.test_getblocktxn_handler(self.nodes[1], self.old_node, 1) - sync_blocks(self.nodes) + self.sync_blocks() self.log.info( "\tTesting compactblock requests/announcements not at chain tip...") self.test_compactblocks_not_at_tip(self.nodes[0], self.test_node) - sync_blocks(self.nodes) + self.sync_blocks() self.test_compactblocks_not_at_tip( self.nodes[1], self.ex_softfork_node) self.test_compactblocks_not_at_tip(self.nodes[1], self.old_node) - sync_blocks(self.nodes) + self.sync_blocks() self.log.info("\tTesting handling of incorrect blocktxn responses...") self.test_incorrect_blocktxn_response(self.nodes[0], self.test_node, 1) - sync_blocks(self.nodes) + self.sync_blocks() self.test_incorrect_blocktxn_response( self.nodes[1], self.ex_softfork_node, 2) - sync_blocks(self.nodes) + self.sync_blocks() # End-to-end block relay tests self.log.info("\tTesting end-to-end block relay...") @@ -924,7 +927,7 @@ "\tTesting reconstructing compact blocks from all peers...") self.test_compactblock_reconstruction_multiple_peers( self.nodes[1], self.ex_softfork_node, self.old_node) - sync_blocks(self.nodes) + self.sync_blocks() self.log.info("\tTesting invalid index in cmpctblock message...") self.test_invalid_cmpctblock_message() diff --git a/test/functional/p2p_feefilter.py b/test/functional/p2p_feefilter.py --- a/test/functional/p2p_feefilter.py +++ b/test/functional/p2p_feefilter.py @@ -13,7 +13,6 @@ P2PInterface, ) from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import sync_blocks, sync_mempools def hashToHex(hash): @@ -58,7 +57,7 @@ node0 = self.nodes[0] # Get out of IBD node1.generate(1) - sync_blocks(self.nodes) + self.sync_blocks() self.nodes[0].add_p2p_connection(TestP2PConn()) @@ -82,7 +81,7 @@ # received node1.settxfee(Decimal("0.00010000")) [node1.sendtoaddress(node1.getnewaddress(), 1) for x in range(3)] - sync_mempools(self.nodes) # must be sure node 0 has received all txs + self.sync_mempools() # must be sure node 0 has received all txs # Send one transaction from node0 that should be received, so that we # we can sync the test on receipt (if node1's txs were relayed, they'd diff --git a/test/functional/p2p_node_network_limited.py b/test/functional/p2p_node_network_limited.py --- a/test/functional/p2p_node_network_limited.py +++ b/test/functional/p2p_node_network_limited.py @@ -25,7 +25,6 @@ assert_equal, connect_nodes_bi, disconnect_nodes, - sync_blocks, wait_until, ) @@ -85,7 +84,7 @@ connect_nodes_bi(self.nodes[0], self.nodes[1]) blocks = self.nodes[1].generatetoaddress( 292, self.nodes[1].get_deterministic_priv_key().address) - sync_blocks([self.nodes[0], self.nodes[1]]) + self.sync_blocks([self.nodes[0], self.nodes[1]]) self.log.info("Make sure we can max retrieve block at tip-288.") # last block in valid range @@ -115,7 +114,7 @@ # sync must not be possible connect_nodes_bi(self.nodes[0], self.nodes[2]) try: - sync_blocks([self.nodes[0], self.nodes[2]], timeout=5) + self.sync_blocks([self.nodes[0], self.nodes[2]], timeout=5) except Exception: pass # node2 must remain at heigh 0 @@ -126,7 +125,7 @@ connect_nodes_bi(self.nodes[1], self.nodes[2]) # sync must be possible - sync_blocks(self.nodes) + self.sync_blocks() # disconnect all peers self.disconnect_all() @@ -141,7 +140,7 @@ # sync must be possible, node 1 is no longer in IBD and should # therefore connect to node 0 (NODE_NETWORK_LIMITED) - sync_blocks([self.nodes[0], self.nodes[1]]) + self.sync_blocks([self.nodes[0], self.nodes[1]]) if __name__ == '__main__': 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 @@ -102,7 +102,10 @@ P2PInterface, ) from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal, sync_blocks, wait_until +from test_framework.util import ( + assert_equal, + wait_until, +) DIRECT_FETCH_RESPONSE_TIME = 0.05 @@ -229,7 +232,7 @@ # make sure all invalidated blocks are node0's self.nodes[0].generatetoaddress( length, self.nodes[0].get_deterministic_priv_key().address) - sync_blocks(self.nodes, wait=0.1) + 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)) @@ -242,7 +245,7 @@ # Must be longer than the orig chain all_hashes = self.nodes[1].generatetoaddress( length + 1, self.nodes[1].get_deterministic_priv_key().address) - sync_blocks(self.nodes, wait=0.1) + 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/p2p_unrequested_blocks.py b/test/functional/p2p_unrequested_blocks.py --- a/test/functional/p2p_unrequested_blocks.py +++ b/test/functional/p2p_unrequested_blocks.py @@ -74,7 +74,6 @@ assert_equal, assert_raises_rpc_error, connect_nodes, - sync_blocks, ) @@ -351,7 +350,7 @@ # 9. Connect node1 to node0 and ensure it is able to sync connect_nodes(self.nodes[0], self.nodes[1]) - sync_blocks([self.nodes[0], self.nodes[1]]) + self.sync_blocks([self.nodes[0], self.nodes[1]]) self.log.info("Successfully synced nodes 1 and 0") diff --git a/test/functional/rpc_getchaintips.py b/test/functional/rpc_getchaintips.py --- a/test/functional/rpc_getchaintips.py +++ b/test/functional/rpc_getchaintips.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2014-2016 The Bitcoin Core developers +# Copyright (c) 2014-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the getchaintips RPC. diff --git a/test/functional/rpc_invalidateblock.py b/test/functional/rpc_invalidateblock.py --- a/test/functional/rpc_invalidateblock.py +++ b/test/functional/rpc_invalidateblock.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2014-2016 The Bitcoin Core developers +# Copyright (c) 2014-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the invalidateblock RPC.""" @@ -7,7 +7,10 @@ import time from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal, connect_nodes_bi, sync_blocks +from test_framework.util import ( + assert_equal, + connect_nodes_bi, +) class InvalidateTest(BitcoinTestFramework): @@ -35,7 +38,7 @@ self.log.info("Connect nodes to force a reorg") connect_nodes_bi(self.nodes[0], self.nodes[1]) - sync_blocks(self.nodes[0:2]) + self.sync_blocks(self.nodes[0:2]) assert self.nodes[0].getblockcount() == 6 badhash = self.nodes[1].getblockhash(2) @@ -51,7 +54,7 @@ self.log.info("\nMake sure we won't reorg to a lower work chain:") connect_nodes_bi(self.nodes[1], self.nodes[2]) self.log.info("Sync node 2 to node 1 so both have 6 blocks") - sync_blocks(self.nodes[1:3]) + self.sync_blocks(self.nodes[1:3]) assert self.nodes[2].getblockcount() == 6 self.log.info("Invalidate block 5 on node 1 so its tip is now at 4") self.nodes[1].invalidateblock(self.nodes[1].getblockhash(5)) diff --git a/test/functional/rpc_preciousblock.py b/test/functional/rpc_preciousblock.py --- a/test/functional/rpc_preciousblock.py +++ b/test/functional/rpc_preciousblock.py @@ -8,7 +8,6 @@ from test_framework.util import ( assert_equal, connect_nodes_bi, - sync_blocks, ) @@ -84,7 +83,7 @@ self.log.info("Make Node1 prefer block C") self.nodes[1].preciousblock(hashC) # wait because node 1 may not have downloaded hashC - sync_blocks(self.nodes[0:2]) + self.sync_blocks(self.nodes[0:2]) assert_equal(self.nodes[1].getbestblockhash(), hashC) self.log.info("Make Node1 prefer block G again") self.nodes[1].preciousblock(hashG) @@ -99,7 +98,7 @@ "Mine another block (E-F-G-)H on Node 0 and reorg Node 1") self.nodes[0].generatetoaddress(1, gen_address(0)) assert_equal(self.nodes[0].getblockcount(), 6) - sync_blocks(self.nodes[0:2]) + self.sync_blocks(self.nodes[0:2]) hashH = self.nodes[0].getbestblockhash() assert_equal(self.nodes[1].getbestblockhash(), hashH) self.log.info("Node1 should not be able to prefer block C anymore") 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 @@ -19,8 +19,6 @@ connect_nodes, disconnect_nodes, satoshi_round, - sync_blocks, - sync_mempools, ) @@ -41,7 +39,7 @@ return satoshi_round(total) self.nodes[1].generate(100) - sync_blocks(self.nodes) + self.sync_blocks() balance = self.nodes[0].getbalance() txA = self.nodes[0].sendtoaddress( self.nodes[0].getnewaddress(), Decimal("10")) @@ -50,7 +48,7 @@ txC = self.nodes[0].sendtoaddress( self.nodes[0].getnewaddress(), Decimal("10")) - sync_mempools(self.nodes) + self.sync_mempools() self.nodes[1].generate(1) # Can not abandon non-wallet transaction @@ -60,7 +58,7 @@ assert_raises_rpc_error(-5, 'Transaction not eligible for abandonment', lambda: self.nodes[0].abandontransaction(txid=txA)) - sync_blocks(self.nodes) + self.sync_blocks() newbalance = self.nodes[0].getbalance() # no more than fees lost @@ -199,7 +197,7 @@ self.nodes[1].generate(1) connect_nodes(self.nodes[0], self.nodes[1]) - sync_blocks(self.nodes) + self.sync_blocks() # Verify that B and C's 10 BCH outputs are available for spending again # because AB1 is now conflicted 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 @@ -40,8 +40,6 @@ assert_equal, assert_greater_than, connect_nodes_bi, - sync_blocks, - sync_mempools, ) @@ -158,7 +156,7 @@ # 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.nodes[4].generate(101) - sync_blocks(self.nodes) + self.sync_blocks() uncompressed_1 = "0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee" uncompressed_2 = "047211a824f55b505228e4c3d5194c1fcfaa15a456abdf37f9b9d97a4040afc073dee6c89064984f03385237d92167c13e236446b417ab79a0fcae412ae3316b77" @@ -217,7 +215,7 @@ self.log.debug("Sending: {}".format(sends)) self.nodes[from_node].sendmany("", sends) - sync_mempools(self.nodes) + self.sync_mempools() unconf_balances = self.get_balances(False) self.log.debug( @@ -229,7 +227,7 @@ # node4 collects fee and block subsidy to keep accounting simple self.nodes[4].generate(1) - sync_blocks(self.nodes) + self.sync_blocks() # Verify that the receiving wallet contains a UTXO with the # expected address, and expected descriptor 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 @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2014-2016 The Bitcoin Core developers +# Copyright (c) 2014-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet backup features. @@ -40,8 +40,6 @@ assert_equal, assert_raises_rpc_error, connect_nodes, - sync_blocks, - sync_mempools, ) @@ -89,9 +87,9 @@ # Have the miner (node3) mine a block. # Must sync mempools before mining. - sync_mempools(self.nodes) + self.sync_mempools() self.nodes[3].generate(1) - sync_blocks(self.nodes) + self.sync_blocks() # As above, this mirrors the original bash test. def start_three(self): @@ -119,13 +117,13 @@ def run_test(self): self.log.info("Generating initial blockchain") self.nodes[0].generate(1) - sync_blocks(self.nodes) + self.sync_blocks() self.nodes[1].generate(1) - sync_blocks(self.nodes) + self.sync_blocks() self.nodes[2].generate(1) - sync_blocks(self.nodes) + self.sync_blocks() self.nodes[3].generate(100) - sync_blocks(self.nodes) + self.sync_blocks() assert_equal(self.nodes[0].getbalance(), 50) assert_equal(self.nodes[1].getbalance(), 50) @@ -191,7 +189,7 @@ self.log.info("Re-starting nodes") self.start_three() - sync_blocks(self.nodes) + self.sync_blocks() assert_equal(self.nodes[0].getbalance(), balance0) assert_equal(self.nodes[1].getbalance(), balance1) @@ -219,7 +217,7 @@ self.nodes[2].importwallet(os.path.join( self.nodes[2].datadir, 'wallet.dump')) - sync_blocks(self.nodes) + self.sync_blocks() assert_equal(self.nodes[0].getbalance(), balance0) assert_equal(self.nodes[1].getbalance(), balance1) 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 @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2018 The Bitcoin Core developers +# Copyright (c) 2018-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet balance RPC methods.""" 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 @@ -15,7 +15,6 @@ assert_raises_rpc_error, connect_nodes_bi, count_bytes, - sync_blocks, wait_until, ) @@ -304,10 +303,10 @@ connect_nodes_bi(self.nodes[0], self.nodes[1]) connect_nodes_bi(self.nodes[1], self.nodes[2]) connect_nodes_bi(self.nodes[0], self.nodes[2]) - sync_blocks(self.nodes[0:3]) + self.sync_blocks(self.nodes[0:3]) self.nodes[0].generate(1) - sync_blocks(self.nodes[0:3]) + self.sync_blocks(self.nodes[0:3]) node_2_bal += 2 # tx should be added to balance because after restarting the nodes tx 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 @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2014-2016 The Bitcoin Core developers +# Copyright (c) 2014-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test wallet import RPCs. @@ -29,7 +29,6 @@ assert_raises_rpc_error, connect_nodes, set_node_times, - sync_blocks, ) @@ -191,7 +190,7 @@ self.nodes[0].getbestblockhash())["time"] set_node_times(self.nodes, timestamp + TIMESTAMP_WINDOW + 1) self.nodes[0].generate(1) - sync_blocks(self.nodes) + self.sync_blocks() # For each variation of wallet key import, invoke the import RPC and # check the results from getbalance and listtransactions. @@ -219,7 +218,7 @@ # Generate a block containing the new transactions. self.nodes[0].generate(1) assert_equal(self.nodes[0].getrawmempool(), []) - sync_blocks(self.nodes) + self.sync_blocks() # Check the latest results from getbalance and listtransactions. for variant in IMPORT_VARIANTS: 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 @@ -17,7 +17,6 @@ from test_framework.util import ( assert_equal, connect_nodes_bi, - sync_blocks, ) @@ -53,7 +52,7 @@ self.nodes[0].generate(1) self.nodes[0].sendtoaddress(addr_extpool, 5) self.nodes[0].generate(1) - sync_blocks(self.nodes) + 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 @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2014-2017 The Bitcoin Core developers +# Copyright (c) 2014-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the listreceivedbyaddress RPC.""" @@ -11,7 +11,6 @@ assert_array_result, assert_equal, assert_raises_rpc_error, - sync_blocks, ) @@ -26,7 +25,7 @@ def run_test(self): # Generate block to get out of IBD self.nodes[0].generate(1) - sync_blocks(self.nodes) + self.sync_blocks() # save the number of coinbase reward addresses so far num_cb_reward_addresses = len( 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 @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2017 The Bitcoin Core developers +# Copyright (c) 2017-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the listsincelast RPC.""" diff --git a/test/functional/wallet_resendwallettransactions.py b/test/functional/wallet_resendwallettransactions.py --- a/test/functional/wallet_resendwallettransactions.py +++ b/test/functional/wallet_resendwallettransactions.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2017-2018 The Bitcoin Core developers +# Copyright (c) 2017-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test that the wallet resends transactions periodically.""" 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 @@ -9,7 +9,6 @@ assert_equal, connect_nodes, disconnect_nodes, - sync_blocks, ) @@ -95,7 +94,7 @@ # Have node0 mine a block, if requested: if (self.options.mine_block): self.nodes[0].generate(1) - sync_blocks(self.nodes[0:2]) + self.sync_blocks(self.nodes[0:2]) tx1 = self.nodes[0].gettransaction(txid1) tx2 = self.nodes[0].gettransaction(txid2) @@ -128,7 +127,7 @@ self.nodes[2].sendrawtransaction(node0_tx2["hex"]) self.nodes[2].sendrawtransaction(tx2["hex"]) self.nodes[2].generate(1) # Mine another block to make sure we sync - sync_blocks(self.nodes) + 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 @@ -11,7 +11,6 @@ connect_nodes, disconnect_nodes, find_output, - sync_blocks, ) @@ -89,7 +88,7 @@ # Have node0 mine a block: if (self.options.mine_block): self.nodes[0].generate(1) - sync_blocks(self.nodes[0:2]) + self.sync_blocks(self.nodes[0:2]) tx1 = self.nodes[0].gettransaction(txid1) tx2 = self.nodes[0].gettransaction(txid2) @@ -123,7 +122,7 @@ # Reconnect the split network, and sync chain: connect_nodes(self.nodes[1], self.nodes[2]) self.nodes[2].generate(1) # Mine another block to make sure we sync - sync_blocks(self.nodes) + self.sync_blocks() assert_equal(self.nodes[0].gettransaction( doublespend_txid)["confirmations"], 2)