0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-07 10:27:47 -05:00

test: reuse block in timewarp check

This commit is contained in:
tdb3 2024-09-21 10:07:59 -04:00
parent 69eae7115d
commit 4631aeb59a
No known key found for this signature in database

View file

@ -160,9 +160,8 @@ class MiningTest(BitcoinTestFramework):
bad_block.solve() bad_block.solve()
assert_raises_rpc_error(-25, 'time-timewarp-attack', lambda: node.submitheader(hexdata=CBlockHeader(bad_block).serialize().hex())) assert_raises_rpc_error(-25, 'time-timewarp-attack', lambda: node.submitheader(hexdata=CBlockHeader(bad_block).serialize().hex()))
bad_block.nTime = t + MAX_FUTURE_BLOCK_TIME - MAX_TIMEWARP block.solve()
bad_block.solve() node.submitheader(hexdata=CBlockHeader(block).serialize().hex())
node.submitheader(hexdata=CBlockHeader(bad_block).serialize().hex())
def run_test(self): def run_test(self):
node = self.nodes[0] node = self.nodes[0]