aboutsummaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-01-18 10:26:42 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-01-18 10:26:48 +0100
commitf2cf071e702ffe5a3fec5e21804d18211af9015d (patch)
treea54cd0b0baedd53411a62ef1795d68f43e889f64 /qa
parentfd9356ba4eb5b3053caf506c750ec4cecb761b6d (diff)
parent4d10d2e16fb837abe304e0a5d3bc0a41941d917a (diff)
downloadbitcoin-f2cf071e702ffe5a3fec5e21804d18211af9015d.tar.xz
Merge pull request #7368
4d10d2e Eliminate race condition in mempool_packages test (Suhas Daftuar)
Diffstat (limited to 'qa')
-rwxr-xr-xqa/rpc-tests/mempool_packages.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/qa/rpc-tests/mempool_packages.py b/qa/rpc-tests/mempool_packages.py
index 063308d394..47c1028b9f 100755
--- a/qa/rpc-tests/mempool_packages.py
+++ b/qa/rpc-tests/mempool_packages.py
@@ -87,9 +87,18 @@ class MempoolPackagesTest(BitcoinTestFramework):
print "too-long-ancestor-chain successfully rejected"
# 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)
+ 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.
self.nodes[0].prioritisetransaction(chain[-1], 0, 2000)
self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())
+ # Keep node1's tip synced with node0
+ self.nodes[1].invalidateblock(self.nodes[1].getbestblockhash())
+
+ # Now check that the transaction is in the mempool, with the right modified fee
mempool = self.nodes[0].getrawmempool(True)
descendant_fees = 0