aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSamer Afach <info@afach.de>2020-03-14 14:44:56 +0100
committerSamer Afach <info@afach.de>2020-03-14 14:44:56 +0100
commit7a6627ae87b637bf32c03122865402bd71adf0d1 (patch)
treeee2e09c1df3e115a73ff40db6aec5c62865e402f /test
parent0653939ac130eddffe40c53ac418bea305d3bf82 (diff)
Fix mining to an invalid target + ensure that a new block has the
correct hash internally in Python tests
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/feature_block.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/functional/feature_block.py b/test/functional/feature_block.py
index 95905f477b..0bedd1d2d7 100755
--- a/test/functional/feature_block.py
+++ b/test/functional/feature_block.py
@@ -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