aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-chainstate.cpp
diff options
context:
space:
mode:
authorRyan Ofsky <ryan@ofsky.org>2023-08-04 16:43:39 -0400
committerRyan Ofsky <ryan@ofsky.org>2023-08-18 12:52:30 -0400
commit94a98fbd1d14a4ea10629b917771d50f3191e944 (patch)
treee6347c9765e91c3e6d7318905262fb1e2088fbfb /src/bitcoin-chainstate.cpp
parent9b066da8af77f971046a42118fd65046321bed1b (diff)
downloadbitcoin-94a98fbd1d14a4ea10629b917771d50f3191e944.tar.xz
assumeutxo cleanup: Move IsInitialBlockDownload & NotifyHeaderTip to ChainstateManager
This change makes IsInitialBlockDownload and NotifyHeaderTip functions no longer tied to individual Chainstate objects. It makes them work with the ChainstateManager object instead so code is simpler and it is no longer possible to call them incorrectly with an inactive Chainstate. This change also makes m_cached_finished_ibd caching easier to reason about, because now there is only one cached value instead of two (for background and snapshot chainstates) so the cached IBD state now no longer gets reset when a snapshot is loaded. There should be no change in behavior because these functions were always called on the active ChainState objects. These changes were discussed previously https://github.com/bitcoin/bitcoin/pull/27746#discussion_r1246868905 and https://github.com/bitcoin/bitcoin/pull/27746#discussion_r1237552792 as possible followups for that PR.
Diffstat (limited to 'src/bitcoin-chainstate.cpp')
-rw-r--r--src/bitcoin-chainstate.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bitcoin-chainstate.cpp b/src/bitcoin-chainstate.cpp
index 580a6badd6..19c4d36126 100644
--- a/src/bitcoin-chainstate.cpp
+++ b/src/bitcoin-chainstate.cpp
@@ -163,7 +163,7 @@ int main(int argc, char* argv[])
<< "\t" << "Reindexing: " << std::boolalpha << node::fReindex.load() << std::noboolalpha << std::endl
<< "\t" << "Snapshot Active: " << std::boolalpha << chainman.IsSnapshotActive() << std::noboolalpha << std::endl
<< "\t" << "Active Height: " << chainman.ActiveHeight() << std::endl
- << "\t" << "Active IBD: " << std::boolalpha << chainman.ActiveChainstate().IsInitialBlockDownload() << std::noboolalpha << std::endl;
+ << "\t" << "Active IBD: " << std::boolalpha << chainman.IsInitialBlockDownload() << std::noboolalpha << std::endl;
CBlockIndex* tip = chainman.ActiveTip();
if (tip) {
std::cout << "\t" << tip->ToString() << std::endl;