versionbits: Use dedicated lock instead of cs_main

This commit is contained in:
Anthony Towns
2020-12-29 22:43:18 +10:00
parent 36a4ba0aaa
commit eccd736f3d
4 changed files with 11 additions and 7 deletions

View File

@@ -6,6 +6,8 @@
#define BITCOIN_VERSIONBITS_H
#include <chain.h>
#include <sync.h>
#include <map>
/** What block version to use for new blocks (pre versionbits) */
@@ -75,7 +77,8 @@ public:
* keyed by the bit position used to signal support. */
struct VersionBitsCache
{
ThresholdConditionCache caches[Consensus::MAX_VERSION_BITS_DEPLOYMENTS];
Mutex mutex;
ThresholdConditionCache caches[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] GUARDED_BY(mutex);
void Clear();
};