diff --git a/src/evo/deterministicmns.cpp b/src/evo/deterministicmns.cpp index 9202f1a4eb2d3..e3e850bdb9df5 100644 --- a/src/evo/deterministicmns.cpp +++ b/src/evo/deterministicmns.cpp @@ -311,16 +311,14 @@ void CDeterministicMNList::PoSePunish(const uint256& proTxHash, int penalty, boo newState->nPoSePenalty += penalty; newState->nPoSePenalty = std::min(maxPenalty, newState->nPoSePenalty); - if (debugLogs && dmn->pdmnState->nPoSePenalty != maxPenalty) { - LogPrintf("CDeterministicMNList::%s -- punished MN %s, penalty %d->%d (max=%d)\n", - __func__, proTxHash.ToString(), dmn->pdmnState->nPoSePenalty, newState->nPoSePenalty, maxPenalty); - } - - if (newState->nPoSePenalty >= maxPenalty && !newState->IsBanned()) { - newState->BanIfNotBanned(nHeight); + if (!dmn->pdmnState->IsBanned()) { + if (newState->nPoSePenalty >= maxPenalty) { + newState->BanIfNotBanned(nHeight); + } if (debugLogs) { - LogPrintf("CDeterministicMNList::%s -- banned MN %s at height %d\n", - __func__, proTxHash.ToString(), nHeight); + LogPrintf("CDeterministicMNList::%s -- %s MN %s at height %d, penalty %d->%d (max=%d)\n", __func__, + newState->IsBanned() ? "banned" : "punished", proTxHash.ToString(), nHeight, + dmn->pdmnState->nPoSePenalty, newState->nPoSePenalty, maxPenalty); } } UpdateMN(proTxHash, newState); @@ -607,7 +605,7 @@ void CDeterministicMNList::RemoveMN(const uint256& proTxHash) if (dmn->nType == MnType::Evo) { if (dmn->pdmnState->platformNodeID != uint160() && !DeleteUniqueProperty(*dmn, dmn->pdmnState->platformNodeID)) { mnUniquePropertyMap = mnUniquePropertyMapSaved; - throw(std::runtime_error(strprintf("%s: Can't delete a masternode %s with a duplicate platformNodeID=%s", __func__, + throw(std::runtime_error(strprintf("%s: Can't delete a masternode %s with a platformNodeID=%s", __func__, dmn->proTxHash.ToString(), dmn->pdmnState->platformNodeID.ToString()))); } } diff --git a/src/evo/specialtxman.cpp b/src/evo/specialtxman.cpp index f0141922f4609..af391c9480c3c 100644 --- a/src/evo/specialtxman.cpp +++ b/src/evo/specialtxman.cpp @@ -582,7 +582,7 @@ bool CSpecialTxProcessor::ProcessSpecialTxsInBlock(const CBlock& block, const CB int64_t nTime5 = GetTimeMicros(); nTimeQuorum += nTime5 - nTime4; - LogPrint(BCLog::BENCHMARK, " - m_qblockman: %.2fms [%.2fs]\n", 0.001 * (nTime5 - nTime4), + LogPrint(BCLog::BENCHMARK, " - m_qblockman.ProcessBlock: %.2fms [%.2fs]\n", 0.001 * (nTime5 - nTime4), nTimeQuorum * 0.000001); CDeterministicMNList mn_list; @@ -601,7 +601,8 @@ bool CSpecialTxProcessor::ProcessSpecialTxsInBlock(const CBlock& block, const CB int64_t nTime6 = GetTimeMicros(); nTimeDMN += nTime6 - nTime5; - LogPrint(BCLog::BENCHMARK, " - m_dmnman: %.2fms [%.2fs]\n", 0.001 * (nTime6 - nTime5), nTimeDMN * 0.000001); + LogPrint(BCLog::BENCHMARK, " - m_dmnman.ProcessBlock: %.2fms [%.2fs]\n", 0.001 * (nTime6 - nTime5), + nTimeDMN * 0.000001); if (opt_cbTx.has_value()) { uint256 calculatedMerkleRootMNL; @@ -655,7 +656,8 @@ bool CSpecialTxProcessor::ProcessSpecialTxsInBlock(const CBlock& block, const CB int64_t nTime8 = GetTimeMicros(); nTimeMnehf += nTime8 - nTime7; - LogPrint(BCLog::BENCHMARK, " - m_mnhfman: %.2fms [%.2fs]\n", 0.001 * (nTime8 - nTime7), nTimeMnehf * 0.000001); + LogPrint(BCLog::BENCHMARK, " - m_mnhfman.ProcessBlock: %.2fms [%.2fs]\n", 0.001 * (nTime8 - nTime7), + nTimeMnehf * 0.000001); if (DeploymentActiveAfter(pindex, m_consensus_params, Consensus::DEPLOYMENT_V19) && bls::bls_legacy_scheme.load()) { // NOTE: The block next to the activation is the one that is using new rules. diff --git a/src/masternode/payments.cpp b/src/masternode/payments.cpp index ee589b694ef6f..3af006c49deed 100644 --- a/src/masternode/payments.cpp +++ b/src/masternode/payments.cpp @@ -127,12 +127,12 @@ CAmount PlatformShare(const CAmount reward) if (!found) { std::string str_payout; if (CTxDestination dest; ExtractDestination(txout.scriptPubKey, dest)) { - str_payout = EncodeDestination(dest); + str_payout = "address=" + EncodeDestination(dest); } else { - str_payout = HexStr(txout.scriptPubKey); + str_payout = "scriptPubKey=" + HexStr(txout.scriptPubKey); } - LogPrintf("CMNPaymentsProcessor::%s -- ERROR! Failed to find expected payee %s in block at height %s\n", - __func__, str_payout, nBlockHeight); + LogPrintf("CMNPaymentsProcessor::%s -- ERROR! Failed to find expected payee %s amount=%lld height=%d\n", + __func__, str_payout, txout.nValue, nBlockHeight); return false; } } diff --git a/src/net.cpp b/src/net.cpp index 5c44be1d8307f..ef6bc2a04b9f7 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1945,7 +1945,7 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr&& sock, bool banned = m_banman && m_banman->IsBanned(addr); if (!NetPermissions::HasFlag(permission_flags, NetPermissionFlags::NoBan) && banned) { - LogPrint(BCLog::NET, "%s (banned)\n", strDropped); + LogPrint(BCLog::NET_NETCONN, "%s (banned)\n", strDropped); return; } @@ -1953,7 +1953,7 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr&& sock, bool discouraged = m_banman && m_banman->IsDiscouraged(addr); if (!NetPermissions::HasFlag(permission_flags, NetPermissionFlags::NoBan) && nInbound + 1 >= nMaxInbound && discouraged) { - LogPrint(BCLog::NET, "connection from %s dropped (discouraged)\n", addr.ToStringAddrPort()); + LogPrint(BCLog::NET_NETCONN, "connection from %s dropped (discouraged)\n", addr.ToStringAddrPort()); return; } @@ -1966,7 +1966,7 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr&& sock, { if (!AttemptToEvictConnection()) { // No connection to evict, disconnect the new connection - LogPrint(BCLog::NET, "failed to find an eviction candidate - connection dropped (full)\n"); + LogPrint(BCLog::NET_NETCONN, "failed to find an eviction candidate - connection dropped (full)\n"); return; } nInbound--; @@ -1974,7 +1974,7 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr&& sock, // don't accept incoming connections until blockchain is synced if (fMasternodeMode && !mn_sync.IsBlockchainSynced()) { - LogPrint(BCLog::NET, "AcceptConnection -- blockchain is not synced yet, skipping inbound connection attempt\n"); + LogPrint(BCLog::NET_NETCONN, "AcceptConnection -- blockchain is not synced yet, skipping inbound connection attempt\n"); return; } @@ -2092,7 +2092,7 @@ void CConnman::DisconnectNodes() // Disconnect any connected nodes for (CNode* pnode : m_nodes) { if (!pnode->fDisconnect) { - LogPrint(BCLog::NET, "Network not active, dropping peer=%d\n", pnode->GetId()); + LogPrint(BCLog::NET_NETCONN, "Network not active, dropping peer=%d\n", pnode->GetId()); pnode->fDisconnect = true; } }