Skip to content

Commit

Permalink
[qa] Test for duplicate inputs within a transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
sdaftuar committed Sep 17, 2018
1 parent b8f8019 commit 9b4a36e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/functional/p2p_invalid_block.py
Expand Up @@ -81,6 +81,16 @@ def run_test(self):

node.p2p.send_blocks_and_test([block2], node, success=False, request_block=False, reject_reason='bad-txns-duplicate')

# Check transactions for duplicate inputs
self.log.info("Test duplicate input block.")

block2_orig.vtx[2].vin.append(block2_orig.vtx[2].vin[0])
block2_orig.vtx[2].rehash()
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')

self.log.info("Test very broken block.")

block3 = create_block(tip, create_coinbase(height), block_time)
Expand Down

0 comments on commit 9b4a36e

Please sign in to comment.