mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-09 06:09:48 +02:00
validation: invert m_cached_finished_ibd to m_cached_is_ibd
Rename and invert the internal IBD latch so the cached value directly matches `IsInitialBlockDownload()` (true while in IBD, then latched to false). This is a behavior-preserving refactor to avoid double negatives.
This commit is contained in:
@@ -1030,13 +1030,11 @@ public:
|
||||
ValidationCache m_validation_cache;
|
||||
|
||||
/**
|
||||
* Whether initial block download has ended and IsInitialBlockDownload
|
||||
* should return false from now on.
|
||||
* Whether initial block download (IBD) is ongoing.
|
||||
*
|
||||
* Mutable because we need to be able to mark IsInitialBlockDownload()
|
||||
* const, which latches this for caching purposes.
|
||||
* Once set to false, IsInitialBlockDownload() will keep returning false.
|
||||
*/
|
||||
mutable std::atomic<bool> m_cached_finished_ibd{false};
|
||||
mutable std::atomic_bool m_cached_is_ibd{true};
|
||||
|
||||
/**
|
||||
* Every received block is assigned a unique and increasing identifier, so we
|
||||
|
||||
Reference in New Issue
Block a user