diff options
author | MacroFake <falke.marco@gmail.com> | 2022-07-21 19:54:15 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-07-21 19:54:18 +0200 |
commit | b8067cd435059eedb580975afc62c4e7a6f27321 (patch) | |
tree | 5a9eaf6c84dcc68828f9fca36847bb1b4e87576f /src/index/base.cpp | |
parent | d1e42659bbdd8da170542d8c638242cd94f71a7d (diff) | |
parent | 11780f29e7c3f50fb7717fc98950ece9385d314b (diff) | |
download | bitcoin-b8067cd435059eedb580975afc62c4e7a6f27321.tar.xz |
Merge bitcoin/bitcoin#22485: doc: BaseIndex sync behavior with empty datadir
11780f29e7c3f50fb7717fc98950ece9385d314b doc: BaseIndex sync behavior with empty datadir (James O'Beirne)
Pull request description:
Make a note about a potentially confusing behavior with `BaseIndex::m_synced`;
if the user starts bitcoind with an empty datadir and an index enabled,
BaseIndex will consider itself synced (as a degenerate case). This affects
how indices are built during IBD (relying solely on BlockConnected signals vs.
using ThreadSync()).
ACKs for top commit:
mzumsande:
ACK 11780f29e7c3f50fb7717fc98950ece9385d314b
Tree-SHA512: 0b530379e57c62e05d2ddca7bb8e2c936786fa00678f9eaa1bb3742d957c48f141d46f936734b03f6673d964abc7eb72c1769f1784b9d3563d218e96296b7afd
Diffstat (limited to 'src/index/base.cpp')
-rw-r--r-- | src/index/base.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/index/base.cpp b/src/index/base.cpp index 2368189da2..1ebe89ef7c 100644 --- a/src/index/base.cpp +++ b/src/index/base.cpp @@ -85,6 +85,10 @@ bool BaseIndex::Init() } else { SetBestBlockIndex(m_chainstate->FindForkInGlobalIndex(locator)); } + + // Note: this will latch to true immediately if the user starts up with an empty + // datadir and an index enabled. If this is the case, indexation will happen solely + // via `BlockConnected` signals until, possibly, the next restart. m_synced = m_best_block_index.load() == active_chain.Tip(); if (!m_synced) { bool prune_violation = false; |