aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_invalid_block.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-11-09 15:58:19 -0500
committerMarcoFalke <falke.marco@gmail.com>2018-11-09 15:46:58 -0500
commitfa2156820877caf70fc09c7e6244b7cde6ebaf29 (patch)
tree86e98a5ecb1390c11f1985f98c853ea340389a54 /test/functional/p2p_invalid_block.py
parent6c787d340cdb67bbdc508b562283750c7ed5dfa8 (diff)
qa: Avoid race in p2p_invalid_block by waiting for the block request
Diffstat (limited to 'test/functional/p2p_invalid_block.py')
-rwxr-xr-xtest/functional/p2p_invalid_block.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/functional/p2p_invalid_block.py b/test/functional/p2p_invalid_block.py
index 0678b1a651..1e0b876593 100755
--- a/test/functional/p2p_invalid_block.py
+++ b/test/functional/p2p_invalid_block.py
@@ -77,9 +77,9 @@ class InvalidBlockRequestTest(BitcoinTestFramework):
block2.vtx.append(tx2)
assert_equal(block2.hashMerkleRoot, block2.calc_merkle_root())
assert_equal(orig_hash, block2.rehash())
- assert(block2_orig.vtx != block2.vtx)
+ assert block2_orig.vtx != block2.vtx
- node.p2p.send_blocks_and_test([block2], node, success=False, request_block=False, reject_reason='bad-txns-duplicate')
+ node.p2p.send_blocks_and_test([block2], node, success=False, reject_reason='bad-txns-duplicate')
# Check transactions for duplicate inputs
self.log.info("Test duplicate input block.")
@@ -89,7 +89,7 @@ class InvalidBlockRequestTest(BitcoinTestFramework):
block2_orig.hashMerkleRoot = block2_orig.calc_merkle_root()
block2_orig.rehash()
block2_orig.solve()
- node.p2p.send_blocks_and_test([block2_orig], node, success=False, request_block=False, reject_reason='bad-txns-inputs-duplicate')
+ node.p2p.send_blocks_and_test([block2_orig], node, success=False, reject_reason='bad-txns-inputs-duplicate')
self.log.info("Test very broken block.")
@@ -102,7 +102,8 @@ class InvalidBlockRequestTest(BitcoinTestFramework):
block3.rehash()
block3.solve()
- node.p2p.send_blocks_and_test([block3], node, success=False, request_block=False, reject_reason='bad-cb-amount')
+ node.p2p.send_blocks_and_test([block3], node, success=False, reject_reason='bad-cb-amount')
+
if __name__ == '__main__':
InvalidBlockRequestTest().main()