Fix mining to an invalid target + ensure that a new block has the
correct hash internally in Python tests
This commit is contained in:
parent
0653939ac1
commit
7a6627ae87
1 changed files with 3 additions and 1 deletions
|
@ -632,7 +632,7 @@ class FullBlockTest(BitcoinTestFramework):
|
|||
self.move_tip(44)
|
||||
b47 = self.next_block(47, solve=False)
|
||||
target = uint256_from_compact(b47.nBits)
|
||||
while b47.sha256 < target:
|
||||
while b47.sha256 <= target:
|
||||
b47.nNonce += 1
|
||||
b47.rehash()
|
||||
self.send_blocks([b47], False, force_send=True, reject_reason='high-hash', reconnect=True)
|
||||
|
@ -1345,6 +1345,8 @@ class FullBlockTest(BitcoinTestFramework):
|
|||
block.hashMerkleRoot = block.calc_merkle_root()
|
||||
if solve:
|
||||
block.solve()
|
||||
else:
|
||||
block.rehash()
|
||||
self.tip = block
|
||||
self.block_heights[block.sha256] = height
|
||||
assert number not in self.blocks
|
||||
|
|
Loading…
Reference in a new issue