Skip to content

Commit 9c94069

Browse files
committed
contrib: timelock coinbase transactions in signet miner
1 parent a5f52cf commit 9c94069

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

contrib/signet/miner

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ PATH_BASE_TEST_FUNCTIONAL = os.path.abspath(os.path.join(PATH_BASE_CONTRIB_SIGNE
1919
sys.path.insert(0, PATH_BASE_TEST_FUNCTIONAL)
2020

2121
from test_framework.blocktools import get_witness_script, script_BIP34_coinbase_height # noqa: E402
22-
from test_framework.messages import CBlock, CBlockHeader, COutPoint, CTransaction, CTxIn, CTxInWitness, CTxOut, from_binary, from_hex, ser_string, ser_uint256, tx_from_hex # noqa: E402
22+
from test_framework.messages import CBlock, CBlockHeader, COutPoint, CTransaction, CTxIn, CTxInWitness, CTxOut, from_binary, from_hex, ser_string, ser_uint256, tx_from_hex, MAX_SEQUENCE_NONFINAL # noqa: E402
2323
from test_framework.psbt import PSBT, PSBTMap, PSBT_GLOBAL_UNSIGNED_TX, PSBT_IN_FINAL_SCRIPTSIG, PSBT_IN_FINAL_SCRIPTWITNESS, PSBT_IN_NON_WITNESS_UTXO, PSBT_IN_SIGHASH_TYPE # noqa: E402
2424
from test_framework.script import CScript, CScriptOp # noqa: E402
2525

@@ -102,7 +102,8 @@ def generate_psbt(tmpl, reward_spk, *, blocktime=None, poolid=None):
102102
scriptSig = CScript(b"" + scriptSig + CScriptOp.encode_op_pushdata(poolid))
103103

104104
cbtx = CTransaction()
105-
cbtx.vin = [CTxIn(COutPoint(0, 0xffffffff), scriptSig, 0xffffffff)]
105+
cbtx.nLockTime = tmpl["height"] - 1
106+
cbtx.vin = [CTxIn(COutPoint(0, 0xffffffff), scriptSig, MAX_SEQUENCE_NONFINAL)]
106107
cbtx.vout = [CTxOut(tmpl["coinbasevalue"], reward_spk)]
107108
cbtx.vin[0].nSequence = 2**32-2
108109
cbtx.rehash()

0 commit comments

Comments
 (0)