mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-15 16:38:23 +01:00
qa: timelock coinbase transactions created in functional tests
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user