diff options
author | Ryan Ofsky <ryan@ofsky.org> | 2022-01-17 20:35:02 -0500 |
---|---|---|
committer | Ryan Ofsky <ryan@ofsky.org> | 2022-07-18 13:39:55 -0500 |
commit | 7878f97bf15b6e7c9b47d1c0d96419b97e1bdcbd (patch) | |
tree | 9367800871923c254038ca199061de2e89569561 /src/index/coinstatsindex.h | |
parent | ee3a079fab2c33b4186b62ab822753954a4e545f (diff) | |
download | bitcoin-7878f97bf15b6e7c9b47d1c0d96419b97e1bdcbd.tar.xz |
indexes, refactor: Remove CChainState use in index CommitInternal method
Replace CommitInternal method with CustomCommit and use interfaces::Chain
instead of CChainState to generate block locator.
This commit does not change behavior in any way, except in the
(m_best_block_index == nullptr) case, which was added recently in
https://github.com/bitcoin/bitcoin/pull/24117 as part of an ongoing attempt to
prevent index corruption if bitcoind is interrupted during startup. New
behavior in that case should be slightly better than the old behavior (skipping
the entire custom+base commit now vs only skipping the base commit previously)
and this might avoid more cases of corruption.
Diffstat (limited to 'src/index/coinstatsindex.h')
-rw-r--r-- | src/index/coinstatsindex.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/index/coinstatsindex.h b/src/index/coinstatsindex.h index 221dd21a20..c4af223388 100644 --- a/src/index/coinstatsindex.h +++ b/src/index/coinstatsindex.h @@ -41,7 +41,7 @@ private: protected: bool CustomInit(const std::optional<interfaces::BlockKey>& block) override; - bool CommitInternal(CDBBatch& batch) override; + bool CustomCommit(CDBBatch& batch) override; bool CustomAppend(const interfaces::BlockInfo& block) override; |