mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-25 21:39:05 +01:00
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.
This commit is contained in:
@@ -790,7 +790,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||
block_3.vtx[0].vout.append(CTxOut(0, CScript([OP_RETURN, WITNESS_COMMITMENT_HEADER + ser_uint256(2), 10])))
|
||||
block_3.vtx[0].rehash()
|
||||
block_3.hashMerkleRoot = block_3.calc_merkle_root()
|
||||
block_3.rehash()
|
||||
block_3.solve()
|
||||
|
||||
test_witness_block(self.nodes[0], self.test_node, block_3, accepted=False, reason='bad-witness-merkle-match')
|
||||
@@ -804,7 +803,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||
block_3.vtx[0].vout[-1].nValue += 1
|
||||
block_3.vtx[0].rehash()
|
||||
block_3.hashMerkleRoot = block_3.calc_merkle_root()
|
||||
block_3.rehash()
|
||||
assert len(block_3.vtx[0].vout) == 4 # 3 OP_returns
|
||||
block_3.solve()
|
||||
test_witness_block(self.nodes[0], self.test_node, block_3, accepted=True)
|
||||
|
||||
Reference in New Issue
Block a user