Skip to content

Commit dfd6ee4

Browse files
UdjinM6codablock
authored andcommitted
Actually update spent index on DisconnectBlock (#3167)
Fixes #3166
1 parent 3c818e9 commit dfd6ee4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/validation.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,13 @@ static DisconnectResult DisconnectBlock(const CBlock& block, const CBlockIndex*
16471647
// move best block pointer to prevout block
16481648
view.SetBestBlock(pindex->pprev->GetBlockHash());
16491649

1650+
if (fSpentIndex) {
1651+
if (!pblocktree->UpdateSpentIndex(spentIndex)) {
1652+
AbortNode("Failed to delete spent index");
1653+
return DISCONNECT_FAILED;
1654+
}
1655+
}
1656+
16501657
if (fAddressIndex) {
16511658
if (!pblocktree->EraseAddressIndex(addressIndex)) {
16521659
AbortNode("Failed to delete address index");

0 commit comments

Comments
 (0)