mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-11 15:19:19 +02:00
refactor: De-globalize last notified header index
In future, users of the kernel library might run multiple chainstates in parallel, or create and destroy multiple chainstates over the lifetime of a process. Having static, mutable variables could lead to state inconsistencies in these scenarios.
This commit is contained in:
@@ -1063,6 +1063,9 @@ public:
|
||||
/** Best header we've seen so far (used for getheaders queries' starting points). */
|
||||
CBlockIndex* m_best_header GUARDED_BY(::cs_main){nullptr};
|
||||
|
||||
/** The last header for which a headerTip notification was issued. */
|
||||
CBlockIndex* m_last_notified_header GUARDED_BY(::cs_main){nullptr};
|
||||
|
||||
//! The total number of bytes available for us to use across all in-memory
|
||||
//! coins caches. This will be split somehow across chainstates.
|
||||
int64_t m_total_coinstip_cache{0};
|
||||
|
||||
Reference in New Issue
Block a user