aboutsummaryrefslogtreecommitdiff
path: root/src/index/base.cpp
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@pm.me>2021-07-18 11:58:47 -0400
committerJames O'Beirne <james.obeirne@pm.me>2022-07-21 10:32:40 -0400
commit11780f29e7c3f50fb7717fc98950ece9385d314b (patch)
tree7e6193e7d089ba0e541d6f5d1bc89f9c18dd40bb /src/index/base.cpp
parent8d4a058ac421da838422da127aac71abf83a49f6 (diff)
downloadbitcoin-11780f29e7c3f50fb7717fc98950ece9385d314b.tar.xz
doc: BaseIndex sync behavior with empty datadir
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()).
Diffstat (limited to 'src/index/base.cpp')
-rw-r--r--src/index/base.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/index/base.cpp b/src/index/base.cpp
index 323547900d..d19f1b231e 100644
--- a/src/index/base.cpp
+++ b/src/index/base.cpp
@@ -69,6 +69,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;