aboutsummaryrefslogtreecommitdiff
path: root/src/validation.h
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@gmail.com>2019-09-16 13:37:29 -0400
committerJames O'Beirne <james.obeirne@pm.me>2020-07-01 14:44:28 -0400
commit8ac3ef46999ed676ca3775f7b2f461d92f09a542 (patch)
tree3bace2a0a4de841a555e04052de69e7cae6ba1de /src/validation.h
parentf36aaa6392fdbdac6891d92202d3efeff98754f4 (diff)
downloadbitcoin-8ac3ef46999ed676ca3775f7b2f461d92f09a542.tar.xz
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.
Diffstat (limited to 'src/validation.h')
-rw-r--r--src/validation.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/validation.h b/src/validation.h
index b201403585..a4948c0187 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -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 */