@@ -119,6 +119,16 @@ void CMasternodeMetaMan::DisallowMixing(const uint256& proTxHash)
119119 mm->nMixingTxCount ++;
120120}
121121
122+ bool CMasternodeMetaMan::IsValidForMixingTxes (const uint256& protx_hash) const
123+ {
124+ LOCK (cs);
125+
126+ auto it = metaInfos.find (protx_hash);
127+ if (it == metaInfos.end ()) return true ;
128+
129+ return it->second ->IsValidForMixingTxes ();
130+ }
131+
122132bool CMasternodeMetaMan::AddGovernanceVote (const uint256& proTxHash, const uint256& nGovernanceObjectHash)
123133{
124134 auto mm = GetMetaInfo (proTxHash);
@@ -215,6 +225,24 @@ bool CMasternodeMetaMan::ResetPlatformBan(const uint256& protx_hash, int height)
215225 return it->second ->SetPlatformBan (false , height);
216226}
217227
228+ bool CMasternodeMetaMan::SetPlatformBan (const uint256& inv_hash, PlatformBanMessage&& ban_msg)
229+ {
230+ LOCK (cs);
231+
232+ const uint256& protx_hash = ban_msg.m_protx_hash ;
233+
234+ auto it = metaInfos.find (protx_hash);
235+ if (it == metaInfos.end ()) {
236+ it = metaInfos.emplace (protx_hash, std::make_shared<CMasternodeMetaInfo>(protx_hash)).first ;
237+ }
238+
239+ bool ret = it->second ->SetPlatformBan (true , ban_msg.m_requested_height );
240+ if (ret) {
241+ m_seen_platform_bans.insert (inv_hash, std::move (ban_msg));
242+ }
243+ return ret;
244+ }
245+
218246bool CMasternodeMetaMan::AlreadyHavePlatformBan (const uint256& inv_hash) const
219247{
220248 LOCK (cs);
@@ -232,12 +260,6 @@ std::optional<PlatformBanMessage> CMasternodeMetaMan::GetPlatformBan(const uint2
232260 return ret;
233261}
234262
235- void CMasternodeMetaMan::RememberPlatformBan (const uint256& inv_hash, PlatformBanMessage&& msg)
236- {
237- LOCK (cs);
238- m_seen_platform_bans.insert (inv_hash, std::move (msg));
239- }
240-
241263void CMasternodeMetaMan::AddUsedMasternode (const uint256& proTxHash)
242264{
243265 LOCK (cs);
0 commit comments