CBOPRET reconsider

This commit is contained in:
jl777
2019-03-31 22:54:42 -11:00
parent 1ee8042e98
commit 0792e959c8

View File

@@ -4120,7 +4120,14 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *
GetMainSignals().BlockChecked(*pblock, state);
if (!rv) {
if (state.IsInvalid())
{
InvalidBlockFound(pindexNew, state);
if ( ASSETCHAINS_CBOPRET != 0 )
{
pindex->nStatus &= ~BLOCK_FAILED_MASK;
fprinf(stderr,"reconsiderblock %d\n",(int32_t)pindex->nHeight);
}
}
return error("ConnectTip(): ConnectBlock %s failed", pindexNew->GetBlockHash().ToString());
}
mapBlockSource.erase(pindexNew->GetBlockHash());
@@ -5211,7 +5218,7 @@ bool AcceptBlockHeader(int32_t *futureblockp,const CBlockHeader& block, CValidat
miSelf->second = pindex = AddToBlockIndex(block);
if (ppindex)
*ppindex = pindex;
if ( pindex != 0 && pindex->nStatus & BLOCK_FAILED_MASK )
if ( pindex != 0 && (pindex->nStatus & BLOCK_FAILED_MASK) != 0 )
{
if ( ASSETCHAINS_CC == 0 )//&& (ASSETCHAINS_PRIVATE == 0 || KOMODO_INSYNC >= Params().GetConsensus().vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight) )
return state.Invalid(error("%s: block is marked invalid", __func__), 0, "duplicate");