@@ -1914,7 +1914,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
1914
1914
REJECT_INVALID, " bad-cb-amount" );
1915
1915
1916
1916
if (!control.Wait ())
1917
- return state.DoS (100 , false );
1917
+ return state.DoS (100 , error ( " %s: CheckQueue failed " , __func__), REJECT_INVALID, " block-validation-failed " );
1918
1918
int64_t nTime4 = GetTimeMicros (); nTimeVerify += nTime4 - nTime2;
1919
1919
LogPrint (BCLog::BENCH, " - Verify %u txins: %.2fms (%.3fms/txin) [%.2fs]\n " , nInputs - 1 , 0.001 * (nTime4 - nTime2), nInputs <= 1 ? 0 : 0.001 * (nTime4 - nTime2) / (nInputs-1 ), nTimeVerify * 0.000001 );
1920
1920
@@ -2882,10 +2882,12 @@ static bool CheckIndexAgainstCheckpoint(const CBlockIndex* pindexPrev, CValidati
2882
2882
return true ;
2883
2883
2884
2884
int nHeight = pindexPrev->nHeight +1 ;
2885
- // Don't accept any forks from the main chain prior to last checkpoint
2885
+ // Don't accept any forks from the main chain prior to last checkpoint.
2886
+ // GetLastCheckpoint finds the last checkpoint in MapCheckpoints that's in our
2887
+ // MapBlockIndex.
2886
2888
CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint (chainparams.Checkpoints ());
2887
2889
if (pcheckpoint && nHeight < pcheckpoint->nHeight )
2888
- return state.DoS (100 , error (" %s: forked chain older than last checkpoint (height %d)" , __func__, nHeight));
2890
+ return state.DoS (100 , error (" %s: forked chain older than last checkpoint (height %d)" , __func__, nHeight), REJECT_CHECKPOINT, " bad-fork-prior-to-checkpoint " );
2889
2891
2890
2892
return true ;
2891
2893
}
@@ -3086,7 +3088,7 @@ static bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state
3086
3088
CBlockIndex* pindexPrev = NULL ;
3087
3089
BlockMap::iterator mi = mapBlockIndex.find (block.hashPrevBlock );
3088
3090
if (mi == mapBlockIndex.end ())
3089
- return state.DoS (10 , error (" %s: prev block not found" , __func__), 0 , " bad-prevblk " );
3091
+ return state.DoS (10 , error (" %s: prev block not found" , __func__), 0 , " prev-blk-not-found " );
3090
3092
pindexPrev = (*mi).second ;
3091
3093
if (pindexPrev->nStatus & BLOCK_FAILED_MASK)
3092
3094
return state.DoS (100 , error (" %s: prev block invalid" , __func__), REJECT_INVALID, " bad-prevblk" );
0 commit comments