mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-18 19:40:40 +01:00
Pass mempool pointer to GetCoinsCacheSizeState
This commit is contained in:
@@ -2227,7 +2227,7 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state,
|
||||
return true;
|
||||
}
|
||||
|
||||
CoinsCacheSizeState CChainState::GetCoinsCacheSizeState(const CTxMemPool& tx_pool)
|
||||
CoinsCacheSizeState CChainState::GetCoinsCacheSizeState(const CTxMemPool* tx_pool)
|
||||
{
|
||||
return this->GetCoinsCacheSizeState(
|
||||
tx_pool,
|
||||
@@ -2236,11 +2236,11 @@ CoinsCacheSizeState CChainState::GetCoinsCacheSizeState(const CTxMemPool& tx_poo
|
||||
}
|
||||
|
||||
CoinsCacheSizeState CChainState::GetCoinsCacheSizeState(
|
||||
const CTxMemPool& tx_pool,
|
||||
const CTxMemPool* tx_pool,
|
||||
size_t max_coins_cache_size_bytes,
|
||||
size_t max_mempool_size_bytes)
|
||||
{
|
||||
int64_t nMempoolUsage = tx_pool.DynamicMemoryUsage();
|
||||
const int64_t nMempoolUsage = tx_pool ? tx_pool->DynamicMemoryUsage() : 0;
|
||||
int64_t cacheSize = CoinsTip().DynamicMemoryUsage();
|
||||
int64_t nTotalSpace =
|
||||
max_coins_cache_size_bytes + std::max<int64_t>(max_mempool_size_bytes - nMempoolUsage, 0);
|
||||
@@ -2279,7 +2279,7 @@ bool CChainState::FlushStateToDisk(
|
||||
{
|
||||
bool fFlushForPrune = false;
|
||||
bool fDoFullFlush = false;
|
||||
CoinsCacheSizeState cache_state = GetCoinsCacheSizeState(::mempool);
|
||||
CoinsCacheSizeState cache_state = GetCoinsCacheSizeState(&::mempool);
|
||||
LOCK(cs_LastBlockFile);
|
||||
if (fPruneMode && (fCheckForPruning || nManualPruneHeight > 0) && !fReindex) {
|
||||
if (nManualPruneHeight > 0) {
|
||||
|
||||
Reference in New Issue
Block a user