qa: timelock coinbase transactions created in functional tests

This commit is contained in:
Antoine Poinsot committed 2025-04-25 12:44:08 -04:00
1 parent 80e6ad9e30
commit a5f52cfcc4
3 files changed
+10 -1

No files matched your search

+5
View File
@@ -30,6 +30,7 @@ from test_framework.blocktools import (
from test_framework.messages import (
CBlock,
SEQUENCE_FINAL,
)
import json
@@ -61,6 +62,10 @@ class MiningMainnetTest(BitcoinTestFramework):
block.nBits = DIFF_1_N_BITS
block.nNonce = blocks['nonces'][height - 1]
block.vtx = [create_coinbase(height=height, script_pubkey=bytes.fromhex(COINBASE_SCRIPT_PUBKEY), retarget_period=2016)]
# The alternate mainnet chain was mined with non-timelocked coinbase txs.
block.vtx[0].nLockTime = 0
block.vtx[0].vin[0].nSequence = SEQUENCE_FINAL
block.vtx[0].rehash()
block.hashMerkleRoot = block.calc_merkle_root()
block.rehash()
block_hex = block.serialize(with_witness=False).hex()