From 636e48b2a8184838ab6af767585fc326e705db33 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sat, 4 Feb 2017 04:41:32 +0400 Subject: [PATCH] fix off-by-1 bug in DisconnectBlocks (#1313) --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 89b0d181e..8f7dc686c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3169,7 +3169,7 @@ bool DisconnectBlocks(int blocks) const CChainParams& chainparams = Params(); 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()) { return false; }