fix off-by-1 bug in DisconnectBlocks (#1313)

This commit is contained in:
UdjinM6 2017-02-04 04:41:32 +04:00 committed by GitHub
parent cedd269cb0
commit 636e48b2a8

View File

@ -3169,7 +3169,7 @@ bool DisconnectBlocks(int blocks)
const CChainParams& chainparams = Params(); const CChainParams& chainparams = Params();
LogPrintf("DisconnectBlocks -- Got command to replay %d blocks\n", blocks); LogPrintf("DisconnectBlocks -- Got command to replay %d blocks\n", blocks);
for(int i = 0; i <= blocks; i++) { for(int i = 0; i < blocks; i++) {
if(!DisconnectTip(state, chainparams.GetConsensus()) || !state.IsValid()) { if(!DisconnectTip(state, chainparams.GetConsensus()) || !state.IsValid()) {
return false; return false;
} }