Skip to content

Commit 296735f

Browse files
committed
Merge bitcoin/bitcoin#27947: MaybePunishNodeForTx: Remove unused message arg and logging
9fe5f6d MaybePunishNodeForTx: Remove unused message arg and logging (Greg Sanders) Pull request description: ACKs for top commit: MarcoFalke: lgtm ACK 9fe5f6d 🕚 dergoegge: utACK 9fe5f6d Tree-SHA512: c40e39b0f6bd738675dadc707a2f5823aad8ddf532afa956579899f2b76edc6fb0bdc1ed78b4ed2f659ffe02c85d1d9fc16667f131e92562c2c0541bd8eee9bd
2 parents 80f04fe + 9fe5f6d commit 296735f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/net_processing.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ class PeerManagerImpl final : public PeerManager
568568
*
569569
* @return Returns true if the peer was punished (probably disconnected)
570570
*/
571-
bool MaybePunishNodeForTx(NodeId nodeid, const TxValidationState& state, const std::string& message = "")
571+
bool MaybePunishNodeForTx(NodeId nodeid, const TxValidationState& state)
572572
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
573573

574574
/** Maybe disconnect a peer and discourage future connections from its address.
@@ -1735,15 +1735,15 @@ bool PeerManagerImpl::MaybePunishNodeForBlock(NodeId nodeid, const BlockValidati
17351735
return false;
17361736
}
17371737

1738-
bool PeerManagerImpl::MaybePunishNodeForTx(NodeId nodeid, const TxValidationState& state, const std::string& message)
1738+
bool PeerManagerImpl::MaybePunishNodeForTx(NodeId nodeid, const TxValidationState& state)
17391739
{
17401740
PeerRef peer{GetPeerRef(nodeid)};
17411741
switch (state.GetResult()) {
17421742
case TxValidationResult::TX_RESULT_UNSET:
17431743
break;
17441744
// The node is providing invalid data:
17451745
case TxValidationResult::TX_CONSENSUS:
1746-
if (peer) Misbehaving(*peer, 100, message);
1746+
if (peer) Misbehaving(*peer, 100, "");
17471747
return true;
17481748
// Conflicting (but not necessarily invalid) data or different policy:
17491749
case TxValidationResult::TX_RECENT_CONSENSUS_CHANGE:
@@ -1758,9 +1758,6 @@ bool PeerManagerImpl::MaybePunishNodeForTx(NodeId nodeid, const TxValidationStat
17581758
case TxValidationResult::TX_NO_MEMPOOL:
17591759
break;
17601760
}
1761-
if (message != "") {
1762-
LogPrint(BCLog::NET, "peer=%d: %s\n", nodeid, message);
1763-
}
17641761
return false;
17651762
}
17661763

0 commit comments

Comments
 (0)