diff --git a/src/main.cpp b/src/main.cpp index 5dc93c611..4fd905a04 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -109,7 +109,7 @@ bool fIsBareMultisigStd = true; bool fCheckBlockIndex = false; bool fCheckpointsEnabled = true; bool fCoinbaseEnforcedProtectionEnabled = true; -size_t nCoinCacheUsage = 5000 * 300; +std::atomic nCoinCacheUsage(5000 * 300); uint64_t nPruneTarget = 0; // If the tip is older than this (in seconds), the node is considered to be in initial block download. int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE; diff --git a/src/main.h b/src/main.h index 028d97b9a..26689de83 100644 --- a/src/main.h +++ b/src/main.h @@ -43,6 +43,7 @@ #include "txmempool.h" #include "uint256.h" +#include #include #include #include @@ -189,7 +190,7 @@ extern bool fCheckpointsEnabled; // TODO: remove this flag by structuring our code such that // it is unneeded for testing extern bool fCoinbaseEnforcedProtectionEnabled; -extern size_t nCoinCacheUsage; +extern std::atomic nCoinCacheUsage; extern CFeeRate minRelayTxFee; extern int64_t nMaxTipAge;