MaybePunishNodeForTx: Remove unused message arg and logging
This commit is contained in:
1 parent
6a473373d4
commit
9fe5f6d5d1
1 file changed
+3
-6
@@ -568,7 +568,7 @@ private:
|
|||||||
*
|
*
|
||||||
* @return Returns true if the peer was punished (probably disconnected)
|
* @return Returns true if the peer was punished (probably disconnected)
|
||||||
*/
|
*/
|
||||||
bool MaybePunishNodeForTx(NodeId nodeid, const TxValidationState& state, const std::string& message = "")
|
bool MaybePunishNodeForTx(NodeId nodeid, const TxValidationState& state)
|
||||||
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||||
|
|
||||||
/** Maybe disconnect a peer and discourage future connections from its address.
|
/** Maybe disconnect a peer and discourage future connections from its address.
|
||||||
@@ -1731,7 +1731,7 @@ bool PeerManagerImpl::MaybePunishNodeForBlock(NodeId nodeid, const BlockValidati
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PeerManagerImpl::MaybePunishNodeForTx(NodeId nodeid, const TxValidationState& state, const std::string& message)
|
bool PeerManagerImpl::MaybePunishNodeForTx(NodeId nodeid, const TxValidationState& state)
|
||||||
{
|
{
|
||||||
PeerRef peer{GetPeerRef(nodeid)};
|
PeerRef peer{GetPeerRef(nodeid)};
|
||||||
switch (state.GetResult()) {
|
switch (state.GetResult()) {
|
||||||
@@ -1739,7 +1739,7 @@ bool PeerManagerImpl::MaybePunishNodeForTx(NodeId nodeid, const TxValidationStat
|
|||||||
break;
|
break;
|
||||||
// The node is providing invalid data:
|
// The node is providing invalid data:
|
||||||
case TxValidationResult::TX_CONSENSUS:
|
case TxValidationResult::TX_CONSENSUS:
|
||||||
if (peer) Misbehaving(*peer, 100, message);
|
if (peer) Misbehaving(*peer, 100, "");
|
||||||
return true;
|
return true;
|
||||||
// Conflicting (but not necessarily invalid) data or different policy:
|
// Conflicting (but not necessarily invalid) data or different policy:
|
||||||
case TxValidationResult::TX_RECENT_CONSENSUS_CHANGE:
|
case TxValidationResult::TX_RECENT_CONSENSUS_CHANGE:
|
||||||
@@ -1754,9 +1754,6 @@ bool PeerManagerImpl::MaybePunishNodeForTx(NodeId nodeid, const TxValidationStat
|
|||||||
case TxValidationResult::TX_NO_MEMPOOL:
|
case TxValidationResult::TX_NO_MEMPOOL:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (message != "") {
|
|
||||||
LogPrint(BCLog::NET, "peer=%d: %s\n", nodeid, message);
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user