Do not throw an error for proof-of-stake blocks in CreateNewBlock()

miner.cpp
This commit is contained in:
lateminer
2018-10-23 21:28:04 +03:00
parent f085b9e0d7
commit d7b72d14d8

View File

@@ -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)));
}