forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
In branch 0.13-bitcore
, which is the most recent, the function DisconnectBlock()
creates a vector to update the spentIndex
database:
Line 2312 in 1f05987
spentIndex.push_back(make_pair(CSpentIndexKey(input.prevout.hash, input.prevout.n), CSpentIndexValue())); |
but never writes it to disk. It's computed without being used. It seems the following code should be added at line 2362 of main.cpp
(this is what ConnectBlock()
does).
if (fSpentIndex) {
if (!pblocktree->UpdateSpentIndex(spentIndex)) {
return AbortNode(state, "Failed to write transaction index");
}
}
Unfortunately, it's hard to write a unit test for this part of the code; an RPC test may be able to reproduce the problem. I have not reproduced the problem; I found it by code inspection while working on zcash/zcash#3708.
Metadata
Metadata
Assignees
Labels
No labels