diff --git a/src/main.cpp b/src/main.cpp index cb3d0ecce..6e6f8ecb9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3132,7 +3132,7 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc pindex = miSelf->second; if (ppindex) *ppindex = pindex; - if (pindex->nStatus & BLOCK_FAILED_MASK) + if (pindex != 0 && pindex->nStatus & BLOCK_FAILED_MASK) return state.Invalid(error("%s: block is marked invalid", __func__), 0, "duplicate"); return true; } diff --git a/src/miner.cpp b/src/miner.cpp index 6b890c858..73eb58cd3 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -357,10 +357,10 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) pblocktemplate->vTxSigOps[0] = GetLegacySigOpCount(pblock->vtx[0]); CValidationState state; - if ( 0 && !TestBlockValidity(state, *pblock, pindexPrev, false, false)) + if ( !TestBlockValidity(state, *pblock, pindexPrev, false, false)) { fprintf(stderr,"testblockvalidity failed\n"); - throw std::runtime_error("CreateNewBlock(): TestBlockValidity failed"); + //throw std::runtime_error("CreateNewBlock(): TestBlockValidity failed"); } }