Skip to content

Commit 063401c

Browse files
committed
PoS miner: add height to the first input scriptSig of the coinstake tx + remove unneded IncrementExtraNonce call in PoS blocks.
1 parent 7fc4680 commit 063401c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/miner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ bool SolveProofOfStake(CBlock* pblock, CBlockIndex* pindexPrev, CWallet* pwallet
182182
pblock->nTime = nTxNewTime;
183183
CMutableTransaction emptyTx;
184184
emptyTx.vin.resize(1);
185+
emptyTx.vin[0].scriptSig = CScript() << pindexPrev->nHeight + 1 << OP_0;
185186
emptyTx.vout.resize(1);
186187
emptyTx.vout[0].SetEmpty();
187188
pblock->vtx.emplace_back(emptyTx);
@@ -446,8 +447,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn, CWallet* pwallet,
446447
pblocktemplate->vTxSigOps[0] = GetLegacySigOpCount(pblock->vtx[0]);
447448

448449
if (fProofOfStake) {
449-
unsigned int nExtraNonce = 0;
450-
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
450+
pblock->hashMerkleRoot = BlockMerkleRoot(*pblock);
451451
LogPrintf("CPUMiner : proof-of-stake block found %s \n", pblock->GetHash().GetHex());
452452
if (!SignBlock(*pblock, *pwallet)) {
453453
LogPrintf("%s: Signing new block with UTXO key failed \n", __func__);

0 commit comments

Comments
 (0)