aboutsummaryrefslogtreecommitdiff
path: root/src/index/txindex.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-05-02 13:04:02 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-05-02 13:11:52 +0200
commit598db389c33e5e90783ef1223df2eeab095ed622 (patch)
tree2f066f0e57be11b3b3c7031817bc3d9a01007beb /src/index/txindex.cpp
parent0bc980b1f65f3739bb9667d58abab1137c0f942a (diff)
parent9cb6cdc59f9eb826b70ebbb6353a5bcee74996e3 (diff)
Merge #13106: Simplify semantics of ChainStateFlushed callback
9cb6cdc Simplify semantics of ChainStateFlushed callback (Matt Corallo) 50b6533 scripted-diff: Rename SetBestChain callback ChainStateFlushed (Matt Corallo) Pull request description: Previously, ChainStateFlushed would fire either if a full flush completed (which can happen due to memory limits, forced flush, or on its own DATABASE_WRITE_INTERVAL timer) *or* on a ChainStateFlushed-specific DATABASE_WRITE_INTERVAL timer. This is both less clear for clients (as there are no guarantees about a flush having actually happened prior to the call), and reults in extra flushes not clearly intended by the code. We drop the second case, providing a strong guarantee without removing the periodit timer-based flushing. This is a follow-up to discussion in #11857. Tree-SHA512: 22ba3a0954d265d28413dbf87040790ca5b439820ee7bbadab14028295ec190de82ce5cd664426c82e58b706dc84278868026fa8d066702eb6e6962c9ace1f8e
Diffstat (limited to 'src/index/txindex.cpp')
-rw-r--r--src/index/txindex.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/index/txindex.cpp b/src/index/txindex.cpp
index 2a661f0330..0bb553ee6a 100644
--- a/src/index/txindex.cpp
+++ b/src/index/txindex.cpp
@@ -192,7 +192,7 @@ void TxIndex::BlockConnected(const std::shared_ptr<const CBlock>& block, const C
}
}
-void TxIndex::SetBestChain(const CBlockLocator& locator)
+void TxIndex::ChainStateFlushed(const CBlockLocator& locator)
{
if (!m_synced) {
return;
@@ -211,7 +211,7 @@ void TxIndex::SetBestChain(const CBlockLocator& locator)
return;
}
- // This checks that SetBestChain callbacks are received after BlockConnected. The check may fail
+ // This checks that ChainStateFlushed callbacks are received after BlockConnected. The check may fail
// immediately after the the sync thread catches up and sets m_synced. Consider the case where
// there is a reorg and the blocks on the stale branch are in the ValidationInterface queue
// backlog even after the sync thread has caught up to the new chain tip. In this unlikely