@@ -182,13 +182,14 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
182182
183183 // Create coinbase transaction.
184184 CMutableTransaction coinbaseTx;
185+ coinbaseTx.nLockTime = nHeight - 1 ;
185186 coinbaseTx.vin .resize (1 );
186187 coinbaseTx.vin [0 ].prevout .SetNull ();
187188 coinbaseTx.vout .resize (1 );
188189 coinbaseTx.vout [0 ].scriptPubKey = nFees ? scriptPubKeyIn : CScript () << OP_RETURN;
189190 coinbaseTx.vout [0 ].nValue = nFees;
190191 coinbaseTx.vout [0 ].nAsset = policyAsset;
191- coinbaseTx.vin [0 ].scriptSig = CScript () << nHeight << OP_0 ;
192+ coinbaseTx.vin [0 ].scriptSig = CScript ();
192193 pblock->vtx [0 ] = MakeTransactionRef (std::move (coinbaseTx));
193194 pblocktemplate->vchCoinbaseCommitment = GenerateCoinbaseCommitment (*pblock, pindexPrev, chainparams.GetConsensus ());
194195 pblocktemplate->vTxFees [0 ] = -nFees;
@@ -633,9 +634,8 @@ void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned
633634 hashPrevBlock = pblock->hashPrevBlock ;
634635 }
635636 ++nExtraNonce;
636- unsigned int nHeight = pindexPrev->nHeight +1 ; // Height first in coinbase required for block.version=2
637637 CMutableTransaction txCoinbase (*pblock->vtx [0 ]);
638- txCoinbase.vin [0 ].scriptSig = (CScript () << nHeight << CScriptNum (nExtraNonce)) + COINBASE_FLAGS;
638+ txCoinbase.vin [0 ].scriptSig = (CScript () << CScriptNum (nExtraNonce)) + COINBASE_FLAGS;
639639 assert (txCoinbase.vin [0 ].scriptSig .size () <= 100 );
640640
641641 pblock->vtx [0 ] = MakeTransactionRef (std::move (txCoinbase));
0 commit comments