Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/coinjoin/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1229,8 +1229,9 @@ bool CCoinJoinClientSession::JoinExistingQueue(CAmount nBalanceNeedsAnonymized,
SetState(POOL_STATE_QUEUE);
nTimeLastSuccessfulStep = GetTime();
WalletCJLogPrint(m_wallet, /* Continued */
"CCoinJoinClientSession::JoinExistingQueue -- pending connection, masternode=%s, nSessionDenom=%d (%s)\n",
dmn->proTxHash.ToString(), nSessionDenom, CoinJoin::DenominationToString(nSessionDenom));
"CCoinJoinClientSession::JoinExistingQueue -- pending connection, masternode=%s, "
"nSessionDenom=%d (%s)\n",
dmn->proTxHash.ToString(), nSessionDenom.load(), CoinJoin::DenominationToString(nSessionDenom));
strAutoDenomResult = _("Trying to connect…");
return true;
}
Expand Down Expand Up @@ -1310,9 +1311,11 @@ bool CCoinJoinClientSession::StartNewQueue(CAmount nBalanceNeedsAnonymized, CCon
pendingDsaRequest = CPendingDsaRequest(dmn->proTxHash, CCoinJoinAccept(nSessionDenom, txMyCollateral));
SetState(POOL_STATE_QUEUE);
nTimeLastSuccessfulStep = GetTime();
WalletCJLogPrint( /* Continued */
m_wallet, "CCoinJoinClientSession::StartNewQueue -- pending connection, masternode=%s, nSessionDenom=%d (%s)\n",
dmn->proTxHash.ToString(), nSessionDenom, CoinJoin::DenominationToString(nSessionDenom));
WalletCJLogPrint(/* Continued */
m_wallet,
"CCoinJoinClientSession::StartNewQueue -- pending connection, masternode=%s, nSessionDenom=%d "
"(%s)\n",
dmn->proTxHash.ToString(), nSessionDenom.load(), CoinJoin::DenominationToString(nSessionDenom));
strAutoDenomResult = _("Trying to connect…");
return true;
}
Expand Down Expand Up @@ -1424,7 +1427,7 @@ bool CCoinJoinClientSession::SubmitDenominate(CConnman& connman)
return a.second > b.second || (a.second == b.second && a.first < b.first);
});

WalletCJLogPrint(m_wallet, "vecInputsByRounds for denom %d\n", nSessionDenom);
WalletCJLogPrint(m_wallet, "vecInputsByRounds for denom %d\n", nSessionDenom.load());
for (const auto& pair : vecInputsByRounds) {
WalletCJLogPrint(m_wallet, "vecInputsByRounds: rounds: %d, inputs: %d\n", pair.first, pair.second);
}
Expand Down
7 changes: 6 additions & 1 deletion src/coinjoin/coinjoin.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,12 @@ class CCoinJoinBaseSession
PoolMessage& nMessageIDRet, bool* fConsumeCollateralRet) const;

public:
int nSessionDenom{0}; // Users must submit a denom matching this
// Users must submit a denom matching this. Atomic like its sibling session fields: it is
// written by the message-handling thread when a session opens and by either thread in
// SetNull(), and read unlocked by both plus RPC threads via GetJsonInfo().
// Note when logging: LogPrint() takes its arguments by const reference so a bare read works,
// but WalletCJLogPrint() takes them by value and needs an explicit .load().
std::atomic<int> nSessionDenom{0};

CCoinJoinBaseSession() = default;
virtual ~CCoinJoinBaseSession() = default;
Expand Down
Loading