From 337bca8125d89a0b9195a8787164e8b59435b5cf Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 3 Nov 2017 00:39:23 -0700 Subject: [PATCH] Fix an issue where qa test wallet_shieldcoinbase could hang. The mempool was not synced so a block could be generated and not clear out the mempool. This would then cause subsequent code which expected the mempool of all nodes to be empty to hang. --- qa/rpc-tests/wallet_shieldcoinbase.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/qa/rpc-tests/wallet_shieldcoinbase.py b/qa/rpc-tests/wallet_shieldcoinbase.py index d1698d945..693326c8a 100755 --- a/qa/rpc-tests/wallet_shieldcoinbase.py +++ b/qa/rpc-tests/wallet_shieldcoinbase.py @@ -6,7 +6,7 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.authproxy import JSONRPCException from test_framework.util import assert_equal, initialize_chain_clean, \ - start_node, connect_nodes_bi, sync_blocks + start_node, connect_nodes_bi, sync_blocks, sync_mempools import time from decimal import Decimal @@ -185,8 +185,10 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework): self.wait_and_assert_operationid_status(0, opid2) # sync_all() invokes sync_mempool() but node 2's mempool limit will cause tx1 and tx2 to be rejected. - # So instead, we sync on blocks, and after a new block is generated, all nodes will have an empty mempool. - sync_blocks(self.nodes) + # So instead, we sync on blocks and mempool for node 0 and node 1, and after a new block is generated + # which mines tx1 and tx2, all nodes will have an empty mempool which can then be synced. + sync_blocks(self.nodes[:2]) + sync_mempools(self.nodes[:2]) self.nodes[1].generate(1) self.sync_all() @@ -215,7 +217,9 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework): assert_equal(result["shieldingUTXOs"], Decimal('33')) assert_equal(result["remainingUTXOs"], Decimal('17')) self.wait_and_assert_operationid_status(0, result['opid']) - sync_blocks(self.nodes) # don't sync on mempool as node 2 will reject thix tx due to its mempooltxinputlimit + # Don't sync node 2 which rejects the tx due to its mempooltxinputlimit + sync_blocks(self.nodes[:2]) + sync_mempools(self.nodes[:2]) self.nodes[1].generate(1) self.sync_all()