diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-12-14 18:16:06 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-12-14 18:12:17 -0500 |
commit | faee59103d8f5f2a5c91711d55c9a1f346593b33 (patch) | |
tree | c3c672eb181c7a6a53876fbbd0d95602b9202284 /test/functional | |
parent | b53573e5c6c7cac3086cbfd22311b31cbc8140ec (diff) | |
download | bitcoin-faee59103d8f5f2a5c91711d55c9a1f346593b33.tar.xz |
test: Fix race in mempool_accept
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/mempool_accept.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/functional/mempool_accept.py b/test/functional/mempool_accept.py index 442aa8e99a..02f1cc4391 100755 --- a/test/functional/mempool_accept.py +++ b/test/functional/mempool_accept.py @@ -58,6 +58,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework): self.mempool_size = 0 wait_until(lambda: node.getblockcount() == 200) assert_equal(node.getmempoolinfo()['size'], self.mempool_size) + coins = node.listunspent() self.log.info('Should not accept garbage to testmempoolaccept') assert_raises_rpc_error(-3, 'Expected type array, got string', lambda: node.testmempoolaccept(rawtxs='ff00baar')) @@ -65,7 +66,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework): assert_raises_rpc_error(-22, 'TX decode failed', lambda: node.testmempoolaccept(rawtxs=['ff00baar'])) self.log.info('A transaction already in the blockchain') - coin = node.listunspent()[0] # Pick a random coin(base) to spend + coin = coins.pop() # Pick a random coin(base) to spend raw_tx_in_block = node.signrawtransactionwithwallet(node.createrawtransaction( inputs=[{'txid': coin['txid'], 'vout': coin['vout']}], outputs=[{node.getnewaddress(): 0.3}, {node.getnewaddress(): 49}], @@ -93,7 +94,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework): ) self.log.info('A final transaction not in the mempool') - coin = node.listunspent()[0] # Pick a random coin(base) to spend + coin = coins.pop() # Pick a random coin(base) to spend raw_tx_final = node.signrawtransactionwithwallet(node.createrawtransaction( inputs=[{'txid': coin['txid'], 'vout': coin['vout'], "sequence": 0xffffffff}], # SEQUENCE_FINAL outputs=[{node.getnewaddress(): 0.025}], |