@@ -35,7 +35,7 @@ class CMasternodeMetaInfo
3535 friend class CMasternodeMetaMan ;
3636
3737private:
38- mutable RecursiveMutex cs;
38+ mutable Mutex cs;
3939
4040 uint256 proTxHash GUARDED_BY (cs);
4141
@@ -127,14 +127,14 @@ class MasternodeMetaStore
127127protected:
128128 static const std::string SERIALIZATION_VERSION_STRING;
129129
130- mutable RecursiveMutex cs;
130+ mutable Mutex cs;
131131 std::map<uint256, CMasternodeMetaInfoPtr> metaInfos GUARDED_BY (cs);
132132 // keep track of dsq count to prevent masternodes from gaming coinjoin queue
133133 std::atomic<int64_t > nDsqCount{0 };
134134
135135public:
136136 template <typename Stream>
137- void Serialize (Stream &s) const
137+ void Serialize (Stream &s) const LOCKS_EXCLUDED(cs)
138138 {
139139 LOCK (cs);
140140 std::vector<CMasternodeMetaInfo> tmpMetaInfo;
@@ -145,7 +145,7 @@ class MasternodeMetaStore
145145 }
146146
147147 template <typename Stream>
148- void Unserialize (Stream &s)
148+ void Unserialize (Stream &s) LOCKS_EXCLUDED(cs)
149149 {
150150 Clear ();
151151
@@ -163,14 +163,14 @@ class MasternodeMetaStore
163163 }
164164 }
165165
166- void Clear ()
166+ void Clear () LOCKS_EXCLUDED(cs)
167167 {
168168 LOCK (cs);
169169
170170 metaInfos.clear ();
171171 }
172172
173- std::string ToString () const ;
173+ std::string ToString () const LOCKS_EXCLUDED(cs) ;
174174};
175175
176176/* *
@@ -233,7 +233,7 @@ class CMasternodeMetaMan : public MasternodeMetaStore
233233
234234 bool IsValid () const { return is_valid; }
235235
236- CMasternodeMetaInfoPtr GetMetaInfo (const uint256& proTxHash, bool fCreate = true );
236+ CMasternodeMetaInfoPtr GetMetaInfo (const uint256& proTxHash, bool fCreate = true ) LOCKS_EXCLUDED(cs) ;
237237
238238 int64_t GetDsqCount () const { return nDsqCount; }
239239 int64_t GetDsqThreshold (const uint256& proTxHash, int nMnCount);
@@ -242,13 +242,13 @@ class CMasternodeMetaMan : public MasternodeMetaStore
242242 void DisallowMixing (const uint256& proTxHash);
243243
244244 bool AddGovernanceVote (const uint256& proTxHash, const uint256& nGovernanceObjectHash);
245- void RemoveGovernanceObject (const uint256& nGovernanceObjectHash);
245+ void RemoveGovernanceObject (const uint256& nGovernanceObjectHash) LOCKS_EXCLUDED(cs) ;
246246
247- std::vector<uint256> GetAndClearDirtyGovernanceObjectHashes ();
247+ std::vector<uint256> GetAndClearDirtyGovernanceObjectHashes () LOCKS_EXCLUDED(cs) ;
248248
249- bool AlreadyHavePlatformBan (const uint256& inv_hash) const ;
250- std::optional<PlatformBanMessage> GetPlatformBan (const uint256& inv_hash) const ;
251- void RememberPlatformBan (const uint256& inv_hash, PlatformBanMessage&& msg);
249+ bool AlreadyHavePlatformBan (const uint256& inv_hash) const LOCKS_EXCLUDED(cs) ;
250+ std::optional<PlatformBanMessage> GetPlatformBan (const uint256& inv_hash) const LOCKS_EXCLUDED(cs) ;
251+ void RememberPlatformBan (const uint256& inv_hash, PlatformBanMessage&& msg) LOCKS_EXCLUDED(cs) ;
252252};
253253
254254#endif // BITCOIN_MASTERNODE_META_H
0 commit comments