aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_invalid_block.py
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-11-12 18:29:43 +0100
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-11-12 18:29:43 +0100
commita9872e1478af10ca335cca32abd248e87e103c02 (patch)
tree4cc5005debf054d56e729c51fb46685c031544b4 /test/functional/p2p_invalid_block.py
parentc9dd5c8d6e59e27af98e99d2844d6ead8eec3162 (diff)
test: remove unnecessary block rehashing prior to solving
Solving a block involves continously rehashing it, i.e. any extra calls to rehash it before are not necessary and can be dropped.
Diffstat (limited to 'test/functional/p2p_invalid_block.py')
-rwxr-xr-xtest/functional/p2p_invalid_block.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/test/functional/p2p_invalid_block.py b/test/functional/p2p_invalid_block.py
index 875ab52db4..6eb8b8767d 100755
--- a/test/functional/p2p_invalid_block.py
+++ b/test/functional/p2p_invalid_block.py
@@ -75,7 +75,6 @@ class InvalidBlockRequestTest(BitcoinTestFramework):
block2.vtx.extend([tx1, tx2])
block2.hashMerkleRoot = block2.calc_merkle_root()
- block2.rehash()
block2.solve()
orig_hash = block2.sha256
block2_orig = copy.deepcopy(block2)
@@ -95,7 +94,6 @@ class InvalidBlockRequestTest(BitcoinTestFramework):
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()
peer.send_blocks_and_test([block2_dup], node, success=False, reject_reason='bad-txns-inputs-duplicate')
@@ -107,7 +105,6 @@ class InvalidBlockRequestTest(BitcoinTestFramework):
block3.vtx[0].sha256 = None
block3.vtx[0].calc_sha256()
block3.hashMerkleRoot = block3.calc_merkle_root()
- block3.rehash()
block3.solve()
peer.send_blocks_and_test([block3], node, success=False, reject_reason='bad-cb-amount')
@@ -134,7 +131,6 @@ class InvalidBlockRequestTest(BitcoinTestFramework):
tx3.rehash()
block4.vtx.append(tx3)
block4.hashMerkleRoot = block4.calc_merkle_root()
- block4.rehash()
block4.solve()
self.log.info("Test inflation by duplicating input")
peer.send_blocks_and_test([block4], node, success=False, reject_reason='bad-txns-inputs-duplicate')