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 @@ -5,7 +5,7 @@ """Test the parckblock and unparkblock RPC calls.""" from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal, wait_until +from test_framework.util import assert_equal, wait_until, sync_blocks class ParkedChainTest(BitcoinTestFramework): @@ -34,6 +34,9 @@ node.generate(10) parked_tip = node.getbestblockhash() + # make sure nodes[1] has caught up + sync_blocks(self.nodes) + # Let's park the chain. assert(parked_tip != tip) assert(block_to_park != tip) @@ -58,6 +61,9 @@ node.generate(1) good_tip = node.getbestblockhash() + # make sure nodes[1] has caught up + sync_blocks(self.nodes) + node.invalidateblock(bad_tip) self.only_valid_tip(tip, other_tip_status="invalid") node.parkblock(bad_tip) @@ -75,6 +81,9 @@ node.generate(1) good_tip = node.getbestblockhash() + # make sure nodes[1] has caught up + sync_blocks(self.nodes) + node.parkblock(bad_tip) self.only_valid_tip(tip, other_tip_status="parked") node.invalidateblock(bad_tip) @@ -95,6 +104,9 @@ node.generate(1) good_tip = node.getbestblockhash() + # make sure nodes[1] has caught up + sync_blocks(self.nodes) + node.invalidateblock(bad_tip) self.only_valid_tip(tip, other_tip_status="invalid") node.parkblock(bad_tip) @@ -112,6 +124,9 @@ node.generate(1) good_tip = node.getbestblockhash() + # make sure nodes[1] has caught up + sync_blocks(self.nodes) + node.parkblock(bad_tip) self.only_valid_tip(tip, other_tip_status="parked") node.invalidateblock(bad_tip)