diff options
| author | Suhas Daftuar <[email protected]> | 2016-01-14 20:35:21 -0500 |
|---|---|---|
| committer | Suhas Daftuar <[email protected]> | 2016-01-14 20:35:21 -0500 |
| commit | 4d10d2e16fb837abe304e0a5d3bc0a41941d917a (patch) | |
| tree | 3b81d0624664ebbb33f77b3b03b3ee24e834683e /qa/rpc-tests/mempool_packages.py | |
| parent | Merge pull request #7298 (diff) | |
| download | discoin-4d10d2e16fb837abe304e0a5d3bc0a41941d917a.tar.xz discoin-4d10d2e16fb837abe304e0a5d3bc0a41941d917a.zip | |
Eliminate race condition in mempool_packages test
Diffstat (limited to 'qa/rpc-tests/mempool_packages.py')
| -rwxr-xr-x | qa/rpc-tests/mempool_packages.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/qa/rpc-tests/mempool_packages.py b/qa/rpc-tests/mempool_packages.py index 063308d39..47c1028b9 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 |