add ChainstateManager::MaybeRebalanceCaches()

Aside from in unittests, this method is unused at the moment. It will be used
in upcoming commits that enable utxo snapshot activation.
This commit is contained in:
James O'Beirne
2019-09-16 13:37:29 -04:00
committed by James O'Beirne
parent f36aaa6392
commit 8ac3ef4699
4 changed files with 99 additions and 0 deletions

View File

@@ -794,6 +794,14 @@ public:
//! chainstate to avoid duplicating block metadata.
BlockManager m_blockman GUARDED_BY(::cs_main);
//! 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};
//
//! The total number of bytes available for us to use across all leveldb
//! coins databases. This will be split somehow across chainstates.
int64_t m_total_coinsdb_cache{0};
//! Instantiate a new chainstate and assign it based upon whether it is
//! from a snapshot.
//!
@@ -881,6 +889,10 @@ public:
//! Clear (deconstruct) chainstate data.
void Reset();
//! Check to see if caches are out of balance and if so, call
//! ResizeCoinsCaches() as needed.
void MaybeRebalanceCaches() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
};
/** DEPRECATED! Please use node.chainman instead. May only be used in validation.cpp internally */