diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2015-03-06 20:26:09 -0500 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-03-11 08:34:43 +0100 |
commit | 002c8a24119d205b09ee10484097a4b18f4a17a9 (patch) | |
tree | e06aa19fa35524ab7e1c2c56c73ab679721c537f /src/bitcoin-cli-res.rc | |
parent | 200f29363b06cbe8e35dfc5e1b818a0dd96c8474 (diff) |
fix possible block db breakage during re-index
When re-indexing, there are a few cases where garbage data may be skipped in
the block files. In these cases, the indices are correctly written to the index
db, however the pointer to the next position for writing in the current block
file is calculated by adding the sizes of the valid blocks found.
As a result, when the re-index is finished, the index db is correct for all
existing blocks, but the next block will be written to an incorrect offset,
likely overwriting existing blocks.
Rather than using the sum of all valid blocks to determine the next write
position, use the end of the last block written to the file. Don't assume that
the current block is the last one in the file, since they may be read
out-of-order.
Rebased-From: bb6acff07982dda68b5c2ac81c99dbd7255bb9cc
Github-Pull: #5864
Diffstat (limited to 'src/bitcoin-cli-res.rc')
0 files changed, 0 insertions, 0 deletions