diff --git a/src/main.cpp b/src/main.cpp index b1b9abe7f0864..6d04896154213 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2360,6 +2360,12 @@ bool DisconnectBlock(const CBlock& block, CValidationState& state, const CBlockI } } + if (fSpentIndex) { + if (!pblocktree->UpdateSpentIndex(spentIndex)) { + return AbortNode(state, "Failed to write transaction index"); + } + } + return fClean; }