mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
fmt: apply clang-format-diff.py
suggestions, satisfy linter
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
This commit is contained in:
parent
7da74ffcd5
commit
e544d3c741
@ -215,7 +215,8 @@ void CCoinJoinClientSession::ProcessMessage(CNode& peer, CChainState& active_cha
|
||||
} else if (msg_type == NetMsgType::DSCOMPLETE) {
|
||||
if (!mixingMasternode) return;
|
||||
if (mixingMasternode->pdmnState->addr != peer.addr) {
|
||||
WalletCJLogPrint(m_wallet, "DSCOMPLETE -- message doesn't match current Masternode: infoMixingMasternode=%s addr=%s\n", mixingMasternode->pdmnState->addr.ToStringAddrPort(), peer.addr.ToStringAddrPort());
|
||||
WalletCJLogPrint(m_wallet, "DSCOMPLETE -- message doesn't match current Masternode: infoMixingMasternode=%s addr=%s\n",
|
||||
mixingMasternode->pdmnState->addr.ToStringAddrPort(), peer.addr.ToStringAddrPort());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1112,7 +1113,9 @@ bool CCoinJoinClientSession::JoinExistingQueue(CAmount nBalanceNeedsAnonymized,
|
||||
m_clientman.AddUsedMasternode(dsq.masternodeOutpoint);
|
||||
|
||||
if (connman.IsMasternodeOrDisconnectRequested(dmn->pdmnState->addr)) {
|
||||
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::JoinExistingQueue -- skipping masternode connection, addr=%s\n", dmn->pdmnState->addr.ToStringAddrPort());
|
||||
WalletCJLogPrint(m_wallet, /* Continued */
|
||||
"CCoinJoinClientSession::JoinExistingQueue -- skipping masternode connection, addr=%s\n",
|
||||
dmn->pdmnState->addr.ToStringAddrPort());
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1122,8 +1125,11 @@ bool CCoinJoinClientSession::JoinExistingQueue(CAmount nBalanceNeedsAnonymized,
|
||||
connman.AddPendingMasternode(dmn->proTxHash);
|
||||
SetState(POOL_STATE_QUEUE);
|
||||
nTimeLastSuccessfulStep = GetTime();
|
||||
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::JoinExistingQueue -- pending connection (from queue): nSessionDenom: %d (%s), addr=%s\n",
|
||||
nSessionDenom, CoinJoin::DenominationToString(nSessionDenom), dmn->pdmnState->addr.ToStringAddrPort());
|
||||
WalletCJLogPrint(m_wallet, /* Continued */
|
||||
"CCoinJoinClientSession::JoinExistingQueue -- pending connection (from queue): nSessionDenom: "
|
||||
"%d (%s), addr=%s\n",
|
||||
nSessionDenom, CoinJoin::DenominationToString(nSessionDenom),
|
||||
dmn->pdmnState->addr.ToStringAddrPort());
|
||||
strAutoDenomResult = _("Trying to connect…");
|
||||
return true;
|
||||
}
|
||||
@ -1173,7 +1179,8 @@ bool CCoinJoinClientSession::StartNewQueue(CAmount nBalanceNeedsAnonymized, CCon
|
||||
int64_t nLastDsq = m_mn_metaman.GetMetaInfo(dmn->proTxHash)->GetLastDsq();
|
||||
int64_t nDsqThreshold = m_mn_metaman.GetDsqThreshold(dmn->proTxHash, nMnCount);
|
||||
if (nLastDsq != 0 && nDsqThreshold > m_mn_metaman.GetDsqCount()) {
|
||||
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::StartNewQueue -- Too early to mix on this masternode!" /* Continued */
|
||||
WalletCJLogPrint(m_wallet, /* Continued */
|
||||
"CCoinJoinClientSession::StartNewQueue -- Too early to mix on this masternode!" /* Continued */
|
||||
" masternode=%s addr=%s nLastDsq=%d nDsqThreshold=%d nDsqCount=%d\n",
|
||||
dmn->proTxHash.ToString(), dmn->pdmnState->addr.ToStringAddrPort(), nLastDsq,
|
||||
nDsqThreshold, m_mn_metaman.GetDsqCount());
|
||||
@ -1182,12 +1189,14 @@ bool CCoinJoinClientSession::StartNewQueue(CAmount nBalanceNeedsAnonymized, CCon
|
||||
}
|
||||
|
||||
if (connman.IsMasternodeOrDisconnectRequested(dmn->pdmnState->addr)) {
|
||||
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::StartNewQueue -- skipping masternode connection, addr=%s\n", dmn->pdmnState->addr.ToStringAddrPort());
|
||||
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::StartNewQueue -- skipping masternode connection, addr=%s\n",
|
||||
dmn->pdmnState->addr.ToStringAddrPort());
|
||||
nTries++;
|
||||
continue;
|
||||
}
|
||||
|
||||
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::StartNewQueue -- attempt %d connection to Masternode %s\n", nTries, dmn->pdmnState->addr.ToStringAddrPort());
|
||||
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::StartNewQueue -- attempt %d connection to Masternode %s\n",
|
||||
nTries, dmn->pdmnState->addr.ToStringAddrPort());
|
||||
|
||||
// try to get a single random denom out of setAmounts
|
||||
while (nSessionDenom == 0) {
|
||||
@ -1203,7 +1212,8 @@ bool CCoinJoinClientSession::StartNewQueue(CAmount nBalanceNeedsAnonymized, CCon
|
||||
pendingDsaRequest = CPendingDsaRequest(dmn->pdmnState->addr, CCoinJoinAccept(nSessionDenom, txMyCollateral));
|
||||
SetState(POOL_STATE_QUEUE);
|
||||
nTimeLastSuccessfulStep = GetTime();
|
||||
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::StartNewQueue -- pending connection, nSessionDenom: %d (%s), addr=%s\n",
|
||||
WalletCJLogPrint( /* Continued */
|
||||
m_wallet, "CCoinJoinClientSession::StartNewQueue -- pending connection, nSessionDenom: %d (%s), addr=%s\n",
|
||||
nSessionDenom, CoinJoin::DenominationToString(nSessionDenom), dmn->pdmnState->addr.ToStringAddrPort());
|
||||
strAutoDenomResult = _("Trying to connect…");
|
||||
return true;
|
||||
@ -1227,7 +1237,8 @@ bool CCoinJoinClientSession::ProcessPendingDsaRequest(CConnman& connman)
|
||||
if (fDone) {
|
||||
pendingDsaRequest = CPendingDsaRequest();
|
||||
} else if (pendingDsaRequest.IsExpired()) {
|
||||
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::%s -- failed to connect to %s\n", __func__, pendingDsaRequest.GetAddr().ToStringAddrPort());
|
||||
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::%s -- failed to connect to %s\n", __func__,
|
||||
pendingDsaRequest.GetAddr().ToStringAddrPort());
|
||||
WITH_LOCK(cs_coinjoin, SetNull());
|
||||
}
|
||||
|
||||
@ -1824,7 +1835,8 @@ void CCoinJoinClientSession::RelayIn(const CCoinJoinEntry& entry, CConnman& conn
|
||||
if (!mixingMasternode) return;
|
||||
|
||||
connman.ForNode(mixingMasternode->pdmnState->addr, [&entry, &connman, this](CNode* pnode) {
|
||||
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::RelayIn -- found master, relaying message to %s\n", pnode->addr.ToStringAddrPort());
|
||||
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::RelayIn -- found master, relaying message to %s\n",
|
||||
pnode->addr.ToStringAddrPort());
|
||||
CNetMsgMaker msgMaker(pnode->GetCommonVersion());
|
||||
connman.PushMessage(pnode, msgMaker.Make(NetMsgType::DSVIN, entry));
|
||||
return true;
|
||||
|
@ -86,7 +86,8 @@ void CCoinJoinServer::ProcessDSACCEPT(CNode& peer, CDataStream& vRecv)
|
||||
int64_t nDsqThreshold = m_mn_metaman.GetDsqThreshold(dmn->proTxHash, mnList.GetValidMNsCount());
|
||||
if (nLastDsq != 0 && nDsqThreshold > m_mn_metaman.GetDsqCount()) {
|
||||
if (fLogIPs) {
|
||||
LogPrint(BCLog::COINJOIN, "DSACCEPT -- last dsq too recent, must wait: peer=%d, addr=%s\n", peer.GetId(), peer.addr.ToStringAddrPort());
|
||||
LogPrint(BCLog::COINJOIN, "DSACCEPT -- last dsq too recent, must wait: peer=%d, addr=%s\n",
|
||||
peer.GetId(), peer.addr.ToStringAddrPort());
|
||||
} else {
|
||||
LogPrint(BCLog::COINJOIN, "DSACCEPT -- last dsq too recent, must wait: peer=%d\n", peer.GetId());
|
||||
}
|
||||
@ -173,12 +174,14 @@ PeerMsgRet CCoinJoinServer::ProcessDSQUEUE(const CNode& peer, CDataStream& vRecv
|
||||
LogPrint(BCLog::COINJOIN, "DSQUEUE -- nLastDsq: %d nDsqThreshold: %d nDsqCount: %d\n", nLastDsq, nDsqThreshold, m_mn_metaman.GetDsqCount());
|
||||
//don't allow a few nodes to dominate the queuing process
|
||||
if (nLastDsq != 0 && nDsqThreshold > m_mn_metaman.GetDsqCount()) {
|
||||
LogPrint(BCLog::COINJOIN, "DSQUEUE -- Masternode %s is sending too many dsq messages\n", dmn->pdmnState->addr.ToStringAddrPort());
|
||||
LogPrint(BCLog::COINJOIN, "DSQUEUE -- Masternode %s is sending too many dsq messages\n",
|
||||
dmn->pdmnState->addr.ToStringAddrPort());
|
||||
return {};
|
||||
}
|
||||
m_mn_metaman.AllowMixing(dmn->proTxHash);
|
||||
|
||||
LogPrint(BCLog::COINJOIN, "DSQUEUE -- new CoinJoin queue (%s) from masternode %s\n", dsq.ToString(), dmn->pdmnState->addr.ToStringAddrPort());
|
||||
LogPrint(BCLog::COINJOIN, "DSQUEUE -- new CoinJoin queue (%s) from masternode %s\n", dsq.ToString(),
|
||||
dmn->pdmnState->addr.ToStringAddrPort());
|
||||
|
||||
TRY_LOCK(cs_vecqueue, lockRecv);
|
||||
if (!lockRecv) return {};
|
||||
|
@ -25,10 +25,14 @@ std::string CDeterministicMNState::ToString() const
|
||||
operatorPayoutAddress = EncodeDestination(dest);
|
||||
}
|
||||
|
||||
return strprintf("CDeterministicMNState(nVersion=%d, nRegisteredHeight=%d, nLastPaidHeight=%d, nPoSePenalty=%d, nPoSeRevivedHeight=%d, nPoSeBanHeight=%d, nRevocationReason=%d, "
|
||||
"ownerAddress=%s, pubKeyOperator=%s, votingAddress=%s, addr=%s, payoutAddress=%s, operatorPayoutAddress=%s)",
|
||||
nVersion, nRegisteredHeight, nLastPaidHeight, nPoSePenalty, nPoSeRevivedHeight, nPoSeBanHeight, nRevocationReason,
|
||||
EncodeDestination(PKHash(keyIDOwner)), pubKeyOperator.ToString(), EncodeDestination(PKHash(keyIDVoting)), addr.ToStringAddrPort(), payoutAddress, operatorPayoutAddress);
|
||||
return strprintf("CDeterministicMNState(nVersion=%d, nRegisteredHeight=%d, nLastPaidHeight=%d, nPoSePenalty=%d, "
|
||||
"nPoSeRevivedHeight=%d, nPoSeBanHeight=%d, nRevocationReason=%d, "
|
||||
"ownerAddress=%s, pubKeyOperator=%s, votingAddress=%s, addr=%s, payoutAddress=%s, "
|
||||
"operatorPayoutAddress=%s)",
|
||||
nVersion, nRegisteredHeight, nLastPaidHeight, nPoSePenalty, nPoSeRevivedHeight, nPoSeBanHeight,
|
||||
nRevocationReason, EncodeDestination(PKHash(keyIDOwner)), pubKeyOperator.ToString(),
|
||||
EncodeDestination(PKHash(keyIDVoting)), addr.ToStringAddrPort(), payoutAddress,
|
||||
operatorPayoutAddress);
|
||||
}
|
||||
|
||||
UniValue CDeterministicMNState::ToJson(MnType nType) const
|
||||
|
@ -87,8 +87,13 @@ std::string CProRegTx::ToString() const
|
||||
payee = EncodeDestination(dest);
|
||||
}
|
||||
|
||||
return strprintf("CProRegTx(nVersion=%d, nType=%d, collateralOutpoint=%s, addr=%s, nOperatorReward=%f, ownerAddress=%s, pubKeyOperator=%s, votingAddress=%s, scriptPayout=%s, platformNodeID=%s, platformP2PPort=%d, platformHTTPPort=%d)",
|
||||
nVersion, ToUnderlying(nType), collateralOutpoint.ToStringShort(), addr.ToStringAddrPort(), (double)nOperatorReward / 100, EncodeDestination(PKHash(keyIDOwner)), pubKeyOperator.ToString(), EncodeDestination(PKHash(keyIDVoting)), payee, platformNodeID.ToString(), platformP2PPort, platformHTTPPort);
|
||||
return strprintf("CProRegTx(nVersion=%d, nType=%d, collateralOutpoint=%s, addr=%s, nOperatorReward=%f, "
|
||||
"ownerAddress=%s, pubKeyOperator=%s, votingAddress=%s, scriptPayout=%s, platformNodeID=%s, "
|
||||
"platformP2PPort=%d, platformHTTPPort=%d)",
|
||||
nVersion, ToUnderlying(nType), collateralOutpoint.ToStringShort(), addr.ToStringAddrPort(),
|
||||
(double)nOperatorReward / 100, EncodeDestination(PKHash(keyIDOwner)), pubKeyOperator.ToString(),
|
||||
EncodeDestination(PKHash(keyIDVoting)), payee, platformNodeID.ToString(), platformP2PPort,
|
||||
platformHTTPPort);
|
||||
}
|
||||
|
||||
bool CProUpServTx::IsTriviallyValid(bool is_basic_scheme_active, TxValidationState& state) const
|
||||
@ -111,8 +116,10 @@ std::string CProUpServTx::ToString() const
|
||||
payee = EncodeDestination(dest);
|
||||
}
|
||||
|
||||
return strprintf("CProUpServTx(nVersion=%d, nType=%d, proTxHash=%s, addr=%s, operatorPayoutAddress=%s, platformNodeID=%s, platformP2PPort=%d, platformHTTPPort=%d)",
|
||||
nVersion, ToUnderlying(nType), proTxHash.ToString(), addr.ToStringAddrPort(), payee, platformNodeID.ToString(), platformP2PPort, platformHTTPPort);
|
||||
return strprintf("CProUpServTx(nVersion=%d, nType=%d, proTxHash=%s, addr=%s, operatorPayoutAddress=%s, "
|
||||
"platformNodeID=%s, platformP2PPort=%d, platformHTTPPort=%d)",
|
||||
nVersion, ToUnderlying(nType), proTxHash.ToString(), addr.ToStringAddrPort(), payee,
|
||||
platformNodeID.ToString(), platformP2PPort, platformHTTPPort);
|
||||
}
|
||||
|
||||
bool CProUpRegTx::IsTriviallyValid(bool is_basic_scheme_active, TxValidationState& state) const
|
||||
|
@ -62,8 +62,12 @@ std::string CSimplifiedMNListEntry::ToString() const
|
||||
operatorPayoutAddress = EncodeDestination(dest);
|
||||
}
|
||||
|
||||
return strprintf("CSimplifiedMNListEntry(nVersion=%d, nType=%d, proRegTxHash=%s, confirmedHash=%s, service=%s, pubKeyOperator=%s, votingAddress=%s, isValid=%d, payoutAddress=%s, operatorPayoutAddress=%s, platformHTTPPort=%d, platformNodeID=%s)",
|
||||
nVersion, ToUnderlying(nType), proRegTxHash.ToString(), confirmedHash.ToString(), service.ToStringAddrPort(), pubKeyOperator.ToString(), EncodeDestination(PKHash(keyIDVoting)), isValid, payoutAddress, operatorPayoutAddress, platformHTTPPort, platformNodeID.ToString());
|
||||
return strprintf("CSimplifiedMNListEntry(nVersion=%d, nType=%d, proRegTxHash=%s, confirmedHash=%s, service=%s, "
|
||||
"pubKeyOperator=%s, votingAddress=%s, isValid=%d, payoutAddress=%s, operatorPayoutAddress=%s, "
|
||||
"platformHTTPPort=%d, platformNodeID=%s)",
|
||||
nVersion, ToUnderlying(nType), proRegTxHash.ToString(), confirmedHash.ToString(),
|
||||
service.ToStringAddrPort(), pubKeyOperator.ToString(), EncodeDestination(PKHash(keyIDVoting)),
|
||||
isValid, payoutAddress, operatorPayoutAddress, platformHTTPPort, platformNodeID.ToString());
|
||||
}
|
||||
|
||||
UniValue CSimplifiedMNListEntry::ToJson(bool extended) const
|
||||
|
@ -81,7 +81,8 @@ void CMasternodeUtils::DoMaintenance(CConnman& connman, CDeterministicMNManager&
|
||||
if (fFound) return; // do NOT disconnect mixing masternodes
|
||||
#endif // ENABLE_WALLET
|
||||
if (fLogIPs) {
|
||||
LogPrint(BCLog::NET_NETCONN, "Closing Masternode connection: peer=%d, addr=%s\n", pnode->GetId(), pnode->addr.ToStringAddrPort());
|
||||
LogPrint(BCLog::NET_NETCONN, "Closing Masternode connection: peer=%d, addr=%s\n", pnode->GetId(),
|
||||
pnode->addr.ToStringAddrPort());
|
||||
} else {
|
||||
LogPrint(BCLog::NET_NETCONN, "Closing Masternode connection: peer=%d\n", pnode->GetId());
|
||||
}
|
||||
|
@ -224,7 +224,8 @@ void MasternodeList::updateDIP3List()
|
||||
// Address, Protocol, Status, Active Seconds, Last Seen, Pub Key
|
||||
auto addr_key = dmn.pdmnState->addr.GetKey();
|
||||
QByteArray addr_ba(reinterpret_cast<const char*>(addr_key.data()), addr_key.size());
|
||||
QTableWidgetItem* addressItem = new CMasternodeListWidgetItem<QByteArray>(QString::fromStdString(dmn.pdmnState->addr.ToStringAddrPort()), addr_ba);
|
||||
QTableWidgetItem* addressItem = new CMasternodeListWidgetItem<QByteArray>(
|
||||
QString::fromStdString(dmn.pdmnState->addr.ToStringAddrPort()), addr_ba);
|
||||
QTableWidgetItem* typeItem = new QTableWidgetItem(QString::fromStdString(std::string(GetMnType(dmn.nType).description)));
|
||||
QTableWidgetItem* statusItem = new QTableWidgetItem(dmn.pdmnState->IsBanned() ? tr("POSE_BANNED") : tr("ENABLED"));
|
||||
QTableWidgetItem* PoSeScoreItem = new CMasternodeListWidgetItem<int>(QString::number(dmn.pdmnState->nPoSePenalty), dmn.pdmnState->nPoSePenalty);
|
||||
|
Loading…
Reference in New Issue
Block a user