mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-10 23:27:54 +00:00
Eliminate race condition in mempool_packages test
This commit is contained in:
parent
b1cf0058d9
commit
4d10d2e16f
@ -87,9 +87,18 @@ class MempoolPackagesTest(BitcoinTestFramework):
|
|||||||
print "too-long-ancestor-chain successfully rejected"
|
print "too-long-ancestor-chain successfully rejected"
|
||||||
|
|
||||||
# Check that prioritising a tx before it's added to the mempool works
|
# 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)
|
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].prioritisetransaction(chain[-1], 0, 2000)
|
||||||
self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())
|
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)
|
mempool = self.nodes[0].getrawmempool(True)
|
||||||
|
|
||||||
descendant_fees = 0
|
descendant_fees = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user