Do not throw an error for proof-of-stake blocks in CreateNewBlock()
miner.cpp
This commit is contained in:
@@ -170,7 +170,9 @@ CBlockTemplate* BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn, in
|
||||
pblock->vtx[0] = coinbaseTx;
|
||||
pblocktemplate->vTxFees[0] = -nFees;
|
||||
|
||||
/*
|
||||
LogPrintf("CreateNewBlock(): total size %u txs: %u fees: %ld sigops %d\n", nBlockSize, nBlockTx, nFees, nBlockSigOpsCost);
|
||||
*/
|
||||
|
||||
if (pFees)
|
||||
*pFees = nFees;
|
||||
@@ -185,7 +187,7 @@ CBlockTemplate* BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn, in
|
||||
pblocktemplate->vTxSigOps[0] = GetLegacySigOpCount(pblock->vtx[0]);
|
||||
|
||||
CValidationState state;
|
||||
if (!TestBlockValidity(state, chainparams, *pblock, pindexPrev, false, false, true)) {
|
||||
if (!fProofOfStake && !TestBlockValidity(state, chainparams, *pblock, pindexPrev, false, false, true)) {
|
||||
throw std::runtime_error(strprintf("%s: TestBlockValidity failed: %s", __func__, FormatStateMessage(state)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user