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

@@ -29,6 +29,7 @@ from .messages import (
tx_from_hex,
uint256_from_compact,
WITNESS_SCALE_FACTOR,
MAX_SEQUENCE_NONFINAL,
)
from .script import (
CScript,
@@ -151,7 +152,8 @@ def create_coinbase(height, pubkey=None, *, script_pubkey=None, extra_output_scr
If extra_output_script is given, make a 0-value output to that
script. This is useful to pad block weight/sigops as needed. """
coinbase = CTransaction()
coinbase.vin.append(CTxIn(COutPoint(0, 0xffffffff), script_BIP34_coinbase_height(height), SEQUENCE_FINAL))
coinbase.nLockTime = height - 1
coinbase.vin.append(CTxIn(COutPoint(0, 0xffffffff), script_BIP34_coinbase_height(height), MAX_SEQUENCE_NONFINAL))
coinbaseoutput = CTxOut()
coinbaseoutput.nValue = nValue * COIN
if nValue == 50: