diff options
author | fanquake <fanquake@gmail.com> | 2022-05-19 14:00:06 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-05-19 14:00:22 +0100 |
commit | e18fd4763e77d1e19208effa9f1a08c5b29fea8e (patch) | |
tree | febe51df3ce14c93345bd3028c01943a0d7c510f /src/i2p.cpp | |
parent | 345d860f38188b1bb6dfb95cb47f8b4057455669 (diff) | |
parent | 7171ebc7cbd911fa7ccad732ea7f73bce30928ee (diff) |
Merge bitcoin/bitcoin#25074: index: During sync, commit best block after indexing
7171ebc7cbd911fa7ccad732ea7f73bce30928ee index: Don't commit a best block before indexing it during sync (Martin Zumsande)
Pull request description:
This changes the periodic commit of the best block during the index sync phase to use the already indexed predecessor of the current block index, instead of committing the current one that will only be indexed (by calling `WriteBlock()`) after committing the best block.
The previous code would leave the index database in an inconsistent state until the block is actually indexed - if an unclean shutdown happened at just this point in time, the index could get corrupted because at next startup, we'd assume that we have already indexed this block.
ACKs for top commit:
ryanofsky:
Code review ACK 7171ebc7cbd911fa7ccad732ea7f73bce30928ee. Looks great! Just commit message changes since last review
Tree-SHA512: a008de511dd6a1731b7fdf6a90add48d1e53f7f7d6402672adb83e362677fc5b9f5cd021d3111728cb41d73f1b9c2140db79d7e183df0ab359cda8c01b0ef928
Diffstat (limited to 'src/i2p.cpp')
0 files changed, 0 insertions, 0 deletions