test: Fix intermittent error in mempool_reorg

This commit is contained in:
MarcoFalke 2020-04-23 18:45:08 -04:00
parent e890c15e2c
commit fae98668d1
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -16,6 +16,12 @@ from test_framework.util import assert_equal, assert_raises_rpc_error
class MempoolCoinbaseTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.extra_args = [
[
'-whitelist=noban@127.0.0.1', # immediate tx relay
],
[]
]
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
@ -67,6 +73,10 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
# Broadcast and mine 103_1:
spend_103_1_id = self.nodes[0].sendrawtransaction(spend_103_1_raw)
last_block = self.nodes[0].generate(1)
# Sync blocks, so that peer 1 gets the block before timelock_tx
# Otherwise, peer 1 would put the timelock_tx in recentRejects
self.sync_all()
# Time-locked transaction can now be spent
timelock_tx_id = self.nodes[0].sendrawtransaction(timelock_tx)