main: don't undo indexes when verifying blocks at startup
This commit is contained in:
parent
4725b25e60
commit
6107ae66d2
16
src/main.cpp
16
src/main.cpp
|
@ -2380,6 +2380,14 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex
|
|||
view.PopAnchor(blockUndo.old_tree_root);
|
||||
|
||||
|
||||
// move best block pointer to prevout block
|
||||
view.SetBestBlock(pindex->pprev->GetBlockHash());
|
||||
|
||||
if (pfClean) {
|
||||
*pfClean = fClean;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (fAddressIndex) {
|
||||
if (!pblocktree->EraseAddressIndex(addressIndex)) {
|
||||
return AbortNode(state, "Failed to delete address index");
|
||||
|
@ -2389,14 +2397,6 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex
|
|||
}
|
||||
}
|
||||
|
||||
// move best block pointer to prevout block
|
||||
view.SetBestBlock(pindex->pprev->GetBlockHash());
|
||||
|
||||
if (pfClean) {
|
||||
*pfClean = fClean;
|
||||
return true;
|
||||
}
|
||||
|
||||
return fClean;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue