Skip to content

Commit 572bafd

Browse files
committed
refactor: rename IsDsqOver to IsMixingThresholdExceeded
1 parent 16915ff commit 572bafd

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/coinjoin/client.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ MessageProcessingResult CCoinJoinClientQueueManager::ProcessMessage(NodeId from,
124124
LogPrint(BCLog::COINJOIN, "DSQUEUE -- CoinJoin queue is ready, masternode=%s, queue=%s\n", dmn->proTxHash.ToString(), dsq.ToString());
125125
return ret;
126126
} else {
127-
if (m_mn_metaman.IsDsqOver(dmn->proTxHash, tip_mn_list.GetValidMNsCount())) {
127+
if (m_mn_metaman.IsMixingThresholdExceeded(dmn->proTxHash, tip_mn_list.GetValidMNsCount())) {
128128
LogPrint(BCLog::COINJOIN, "DSQUEUE -- Masternode %s is sending too many dsq messages\n",
129129
dmn->proTxHash.ToString());
130130
return ret;
@@ -1174,7 +1174,7 @@ bool CCoinJoinClientSession::StartNewQueue(CAmount nBalanceNeedsAnonymized, CCon
11741174
continue;
11751175
}
11761176

1177-
if (m_mn_metaman.IsDsqOver(dmn->proTxHash, nMnCount)) {
1177+
if (m_mn_metaman.IsMixingThresholdExceeded(dmn->proTxHash, nMnCount)) {
11781178
WalletCJLogPrint(m_wallet, /* Continued */
11791179
"CCoinJoinClientSession::StartNewQueue -- too early to mix with node masternode=%s\n",
11801180
dmn->proTxHash.ToString());

src/coinjoin/server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void CCoinJoinServer::ProcessDSACCEPT(CNode& peer, CDataStream& vRecv)
9999
}
100100
}
101101

102-
if (m_mn_metaman.IsDsqOver(dmn->proTxHash, mnList.GetValidMNsCount())) {
102+
if (m_mn_metaman.IsMixingThresholdExceeded(dmn->proTxHash, mnList.GetValidMNsCount())) {
103103
if (fLogIPs) {
104104
LogPrint(BCLog::COINJOIN, "DSACCEPT -- last dsq too recent, must wait: peer=%d, addr=%s\n",
105105
peer.GetId(), peer.addr.ToStringAddrPort());
@@ -193,7 +193,7 @@ MessageProcessingResult CCoinJoinServer::ProcessDSQUEUE(NodeId from, CDataStream
193193

194194
if (!dsq.fReady) {
195195
//don't allow a few nodes to dominate the queuing process
196-
if (m_mn_metaman.IsDsqOver(dmn->proTxHash, tip_mn_list.GetValidMNsCount())) {
196+
if (m_mn_metaman.IsMixingThresholdExceeded(dmn->proTxHash, tip_mn_list.GetValidMNsCount())) {
197197
LogPrint(BCLog::COINJOIN, "DSQUEUE -- node sending too many dsq messages, masternode=%s\n", dmn->proTxHash.ToString());
198198
return ret;
199199
}

src/masternode/meta.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ CMasternodeMetaInfo& CMasternodeMetaMan::GetMetaInfo(const uint256& proTxHash)
9090
return it->second;
9191
}
9292

93-
bool CMasternodeMetaMan::IsDsqOver(const uint256& protx_hash, int mn_count) const
93+
bool CMasternodeMetaMan::IsMixingThresholdExceeded(const uint256& protx_hash, int mn_count) const
9494
{
9595
LOCK(cs);
9696
auto it = metaInfos.find(protx_hash);

src/masternode/meta.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class CMasternodeMetaMan : public MasternodeMetaStore
219219
// MN's threshold is calculated as the last dsq count this specific masternode was used in a mixing
220220
// session plus a margin of 20% of masternode count. In other words we expect at least 20% of unique
221221
// masternodes before we ever see a masternode that we know already mixed someone's funds earlier.
222-
bool IsDsqOver(const uint256& protx_hash, int mn_count) const EXCLUSIVE_LOCKS_REQUIRED(!cs);
222+
bool IsMixingThresholdExceeded(const uint256& protx_hash, int mn_count) const EXCLUSIVE_LOCKS_REQUIRED(!cs);
223223

224224
void AllowMixing(const uint256& proTxHash) EXCLUSIVE_LOCKS_REQUIRED(!cs);
225225
void DisallowMixing(const uint256& proTxHash) EXCLUSIVE_LOCKS_REQUIRED(!cs);

0 commit comments

Comments
 (0)