@@ -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 (" 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
@@ -2881,10 +2881,12 @@ static bool CheckIndexAgainstCheckpoint(const CBlockIndex* pindexPrev, CValidati
2881
2881
return true ;
2882
2882
2883
2883
int nHeight = pindexPrev->nHeight +1 ;
2884
- // Don't accept any forks from the main chain prior to last checkpoint
2884
+ // Don't accept any forks from the main chain prior to last checkpoint.
2885
+ // GetLastCheckpoint finds the last checkpoint in MapCheckpoints that's in our
2886
+ // MapBlockIndex.
2885
2887
CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint (chainparams.Checkpoints ());
2886
2888
if (pcheckpoint && nHeight < pcheckpoint->nHeight )
2887
- return state.DoS (100 , error (" %s: forked chain older than last checkpoint (height %d)" , __func__, nHeight));
2889
+ return state.DoS (100 , error (" %s: forked chain older than last checkpoint (height %d)" , __func__, nHeight), REJECT_CHECKPOINT, " bad-fork-prior-to-checkpoint " );
2888
2890
2889
2891
return true ;
2890
2892
}
@@ -3083,7 +3085,7 @@ static bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state
3083
3085
CBlockIndex* pindexPrev = NULL ;
3084
3086
BlockMap::iterator mi = mapBlockIndex.find (block.hashPrevBlock );
3085
3087
if (mi == mapBlockIndex.end ())
3086
- return state.DoS (10 , error (" %s: prev block not found" , __func__), 0 , " bad-prevblk " );
3088
+ return state.DoS (10 , error (" %s: prev block not found" , __func__), 0 , " prev-blk-not-found " );
3087
3089
pindexPrev = (*mi).second ;
3088
3090
if (pindexPrev->nStatus & BLOCK_FAILED_MASK)
3089
3091
return state.DoS (100 , error (" %s: prev block invalid" , __func__), REJECT_INVALID, " bad-prevblk" );
0 commit comments