aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_invalid_block.py
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-09-18 01:25:52 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-09-18 01:25:55 +0200
commit696b936aa3ab6f459d0e16f9805eaeb747a0036c (patch)
tree5d3209f5bf1e2d2e780c590607d3369a3962638f /test/functional/p2p_invalid_block.py
parent9e116a6f8720c10c2f4e295107e217fbf7a9a20d (diff)
parent9bd08fd465c35f08f3aab3c713ce1d70ddc1c492 (diff)
Merge #14249: [0.16] Fix crash bug with duplicate inputs within a transaction
9bd08fd465c35f08f3aab3c713ce1d70ddc1c492 [qa] backport: Test for duplicate inputs within a transaction (Suhas Daftuar) d1dee205473140aca34180e5de8b9bbe17c2207d Fix crash bug with duplicate inputs within a transaction (Suhas Daftuar) Pull request description: This is a backport of #14247 to 0.16. Tree-SHA512: f11b2b0f2d8089bbac7542f78a0f14fc15c693604cb1168ef5ea71852a206da7eb53b6e420376ed1380583961176ba2d283e409e19d783c7a68c3407933a89b0
Diffstat (limited to 'test/functional/p2p_invalid_block.py')
-rwxr-xr-xtest/functional/p2p_invalid_block.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/functional/p2p_invalid_block.py b/test/functional/p2p_invalid_block.py
index edcade63c1..7744526d9a 100755
--- a/test/functional/p2p_invalid_block.py
+++ b/test/functional/p2p_invalid_block.py
@@ -95,7 +95,18 @@ class InvalidBlockRequestTest(ComparisonTestFramework):
assert(block2_orig.vtx != block2.vtx)
self.tip = block2.sha256
- yield TestInstance([[block2, RejectResult(16, b'bad-txns-duplicate')], [block2_orig, True]])
+ yield TestInstance([[block2, RejectResult(16, b'bad-txns-duplicate')]])
+
+ # Check transactions for duplicate inputs
+ self.log.info("Test duplicate input block.")
+
+ block2_dup = copy.deepcopy(block2_orig)
+ block2_dup.vtx[2].vin.append(block2_dup.vtx[2].vin[0])
+ block2_dup.vtx[2].rehash()
+ block2_dup.hashMerkleRoot = block2_dup.calc_merkle_root()
+ block2_dup.rehash()
+ block2_dup.solve()
+ yield TestInstance([[block2_dup, RejectResult(16, b'bad-txns-inputs-duplicate')], [block2_orig, True]])
height += 1
'''