fix off-by-1 bug in DisconnectBlocks (#1313)
This commit is contained in:
parent
cedd269cb0
commit
636e48b2a8
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user