diff --git a/src/evo/deterministicmns.h b/src/evo/deterministicmns.h index df6072c4bc..9202f19b22 100644 --- a/src/evo/deterministicmns.h +++ b/src/evo/deterministicmns.h @@ -603,21 +603,21 @@ public: ~CDeterministicMNManager() = default; bool ProcessBlock(const CBlock& block, gsl::not_null pindex, BlockValidationState& state, - const CCoinsViewCache& view, bool fJustCheck, std::optional& updatesRet) EXCLUSIVE_LOCKS_REQUIRED(cs_main) LOCKS_EXCLUDED(cs); - bool UndoBlock(gsl::not_null pindex, std::optional& updatesRet) LOCKS_EXCLUDED(cs); + const CCoinsViewCache& view, bool fJustCheck, std::optional& updatesRet) EXCLUSIVE_LOCKS_REQUIRED(!cs, cs_main); + bool UndoBlock(gsl::not_null pindex, std::optional& updatesRet) EXCLUSIVE_LOCKS_REQUIRED(!cs); - void UpdatedBlockTip(gsl::not_null pindex) LOCKS_EXCLUDED(cs); + void UpdatedBlockTip(gsl::not_null pindex) EXCLUSIVE_LOCKS_REQUIRED(!cs); // the returned list will not contain the correct block hash (we can't know it yet as the coinbase TX is not updated yet) bool BuildNewListFromBlock(const CBlock& block, gsl::not_null pindexPrev, BlockValidationState& state, const CCoinsViewCache& view, - CDeterministicMNList& mnListRet, bool debugLogs) LOCKS_EXCLUDED(cs); + CDeterministicMNList& mnListRet, bool debugLogs) EXCLUSIVE_LOCKS_REQUIRED(!cs); void HandleQuorumCommitment(const llmq::CFinalCommitment& qc, gsl::not_null pQuorumBaseBlockIndex, CDeterministicMNList& mnList, bool debugLogs); - CDeterministicMNList GetListForBlock(gsl::not_null pindex) LOCKS_EXCLUDED(cs) { + CDeterministicMNList GetListForBlock(gsl::not_null pindex) EXCLUSIVE_LOCKS_REQUIRED(!cs) { LOCK(cs); return GetListForBlockInternal(pindex); }; - CDeterministicMNList GetListAtChainTip() LOCKS_EXCLUDED(cs); + CDeterministicMNList GetListAtChainTip() EXCLUSIVE_LOCKS_REQUIRED(!cs); // Test if given TX is a ProRegTx which also contains the collateral at index n static bool IsProTxWithCollateral(const CTransactionRef& tx, uint32_t n); @@ -625,7 +625,7 @@ public: bool MigrateDBIfNeeded(); bool MigrateDBIfNeeded2(); - void DoMaintenance() LOCKS_EXCLUDED(cs); + void DoMaintenance() EXCLUSIVE_LOCKS_REQUIRED(!cs); private: void CleanupCache(int nHeight) EXCLUSIVE_LOCKS_REQUIRED(cs); diff --git a/src/evo/evodb.h b/src/evo/evodb.h index 5debd14430..a0d6407606 100644 --- a/src/evo/evodb.h +++ b/src/evo/evodb.h @@ -48,7 +48,7 @@ private: public: explicit CEvoDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false); - std::unique_ptr BeginTransaction() LOCKS_EXCLUDED(cs) + std::unique_ptr BeginTransaction() EXCLUSIVE_LOCKS_REQUIRED(!cs) { LOCK(cs); return std::make_unique(*this); @@ -61,28 +61,28 @@ public: } template - bool Read(const K& key, V& value) LOCKS_EXCLUDED(cs) + bool Read(const K& key, V& value) EXCLUSIVE_LOCKS_REQUIRED(!cs) { LOCK(cs); return curDBTransaction.Read(key, value); } template - void Write(const K& key, const V& value) LOCKS_EXCLUDED(cs) + void Write(const K& key, const V& value) EXCLUSIVE_LOCKS_REQUIRED(!cs) { LOCK(cs); curDBTransaction.Write(key, value); } template - bool Exists(const K& key) LOCKS_EXCLUDED(cs) + bool Exists(const K& key) EXCLUSIVE_LOCKS_REQUIRED(!cs) { LOCK(cs); return curDBTransaction.Exists(key); } template - void Erase(const K& key) LOCKS_EXCLUDED(cs) + void Erase(const K& key) EXCLUSIVE_LOCKS_REQUIRED(!cs) { LOCK(cs); curDBTransaction.Erase(key); @@ -98,18 +98,18 @@ public: return rootDBTransaction.GetMemoryUsage(); } - bool CommitRootTransaction() LOCKS_EXCLUDED(cs); + bool CommitRootTransaction() EXCLUSIVE_LOCKS_REQUIRED(!cs); bool IsEmpty() { return db.IsEmpty(); } - bool VerifyBestBlock(const uint256& hash); - void WriteBestBlock(const uint256& hash); + bool VerifyBestBlock(const uint256& hash) EXCLUSIVE_LOCKS_REQUIRED(!cs); + void WriteBestBlock(const uint256& hash) EXCLUSIVE_LOCKS_REQUIRED(!cs); private: // only CEvoDBScopedCommitter is allowed to invoke these friend class CEvoDBScopedCommitter; - void CommitCurTransaction() LOCKS_EXCLUDED(cs); - void RollbackCurTransaction() LOCKS_EXCLUDED(cs); + void CommitCurTransaction() EXCLUSIVE_LOCKS_REQUIRED(!cs); + void RollbackCurTransaction() EXCLUSIVE_LOCKS_REQUIRED(!cs); }; #endif // BITCOIN_EVO_EVODB_H diff --git a/src/evo/mnhftx.h b/src/evo/mnhftx.h index b09cc35594..63d8f07cca 100644 --- a/src/evo/mnhftx.h +++ b/src/evo/mnhftx.h @@ -128,7 +128,7 @@ public: /** * Helper that used in Unit Test to forcely setup EHF signal for specific block */ - void AddSignal(const CBlockIndex* const pindex, int bit) LOCKS_EXCLUDED(cs_cache); + void AddSignal(const CBlockIndex* const pindex, int bit) EXCLUSIVE_LOCKS_REQUIRED(!cs_cache); private: void AddToCache(const Signals& signals, const CBlockIndex* const pindex); diff --git a/src/masternode/node.h b/src/masternode/node.h index d63e14b5d9..738b6a7ac9 100644 --- a/src/masternode/node.h +++ b/src/masternode/node.h @@ -53,9 +53,10 @@ private: public: explicit CActiveMasternodeManager(const CBLSSecretKey& sk, CConnman& connman, const std::unique_ptr& dmnman); - void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload) override; + void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload) override + EXCLUSIVE_LOCKS_REQUIRED(!cs); - void Init(const CBlockIndex* pindex) LOCKS_EXCLUDED(cs) { LOCK(cs); InitInternal(pindex); }; + void Init(const CBlockIndex* pindex) EXCLUSIVE_LOCKS_REQUIRED(!cs) { LOCK(cs); InitInternal(pindex); }; std::string GetStateString() const; std::string GetStatus() const; @@ -64,9 +65,9 @@ public: template