qa: timelock coinbase transactions created in functional tests

This commit is contained in:
Antoine Poinsot
2025-04-21 15:12:48 -04:00
parent 80e6ad9e30
commit a5f52cfcc4
3 changed files with 10 additions and 1 deletions

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()