diff options
author | warptangent <warptangent@tutanota.com> | 2015-12-24 12:25:07 -0800 |
---|---|---|
committer | warptangent <warptangent@tutanota.com> | 2015-12-24 13:32:35 -0800 |
commit | ffcf6bdb95abe2dab37d5f8d9acc134fdc6b4d36 (patch) | |
tree | 96052a5ae40d88f9b5c925d3f4abc0867479f013 /src/blockchain_db/blockchain_db.cpp | |
parent | BlockchainLMDB: Remove tx outputs in reverse order (diff) | |
download | monero-ffcf6bdb95abe2dab37d5f8d9acc134fdc6b4d36.tar.xz |
BlockchainLMDB: When removing, find amount output index fast by starting at end
This improves blockchain reorganization time by allowing one of the more
expensive DB lookups when popping a block to not have to seek through a
long dup list in the "output_amounts" subdb. This is most noticeable for
HDDs.
As before, the dup list is still walked if necessary (but in reverse),
and the global output index still confirmed to be the one looked for.
But under proper use, the result will be found at the end of the dup
list, so we start there.
Removing an amount output index is always done in the context of popping
a block, so the global output index being looked for should be the last
one in that amount key's dup list. Even if the txs themselves aren't
removed in reverse order (supposed to be according to original
implementation), the specified amount output index will still be near
the end, because the txs are in the same block.
TEST:
Pop blocks with blockchain_import.
Blocks should be successfully removed with no errors shown.
bitmonerod should be able to start syncing from the reduced blockchain
height.
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions