aboutsummaryrefslogtreecommitdiff
path: root/src/index/base.h
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.h
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.h')
-rw-r--r--src/index/base.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/index/base.h b/src/index/base.h
index a8f6a18c8d..6dfaa4361e 100644
--- a/src/index/base.h
+++ b/src/index/base.h
@@ -51,6 +51,10 @@ private:
/// Whether the index is in sync with the main chain. The flag is flipped
/// from false to true once, after which point this starts processing
/// ValidationInterface notifications to stay in sync.
+ ///
+ /// Note that this will latch to true *immediately* upon startup if
+ /// `m_chainstate->m_chain` is empty, which will be the case upon startup
+ /// with an empty datadir if, e.g., `-txindex=1` is specified.
std::atomic<bool> m_synced{false};
/// The last block in the chain that the index is in sync with.