mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Merge 2f71a1ea35 into merged_master (Bitcoin PR #18637)
This commit is contained in:
commit
12f11f8f70
12 changed files with 286 additions and 34 deletions
|
|
@ -1588,7 +1588,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node)
|
|||
int64_t nCoinDBCache = std::min(nTotalCache / 2, (nTotalCache / 4) + (1 << 23)); // use 25%-50% of the remainder for disk cache
|
||||
nCoinDBCache = std::min(nCoinDBCache, nMaxCoinsDBCache << 20); // cap total coins db cache
|
||||
nTotalCache -= nCoinDBCache;
|
||||
nCoinCacheUsage = nTotalCache; // the rest goes to in-memory cache
|
||||
int64_t nCoinCacheUsage = nTotalCache; // the rest goes to in-memory cache
|
||||
int64_t nMempoolSizeMax = gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000;
|
||||
LogPrintf("Cache configuration:\n");
|
||||
LogPrintf("* Using %.1f MiB for block index database\n", nBlockTreeDBCache * (1.0 / 1024 / 1024));
|
||||
|
|
@ -1617,6 +1617,9 @@ bool AppInitMain(const util::Ref& context, NodeContext& node)
|
|||
try {
|
||||
LOCK(cs_main);
|
||||
chainman.InitializeChainstate();
|
||||
chainman.m_total_coinstip_cache = nCoinCacheUsage;
|
||||
chainman.m_total_coinsdb_cache = nCoinDBCache;
|
||||
|
||||
UnloadBlockIndex();
|
||||
|
||||
// new CBlockTreeDB tries to delete the existing file, which
|
||||
|
|
@ -1700,7 +1703,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node)
|
|||
}
|
||||
|
||||
// The on-disk coinsdb is now in a good state, create the cache
|
||||
chainstate->InitCoinsCache();
|
||||
chainstate->InitCoinsCache(nCoinCacheUsage);
|
||||
assert(chainstate->CanFlushToDisk());
|
||||
|
||||
if (!is_coinsview_empty(chainstate)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue