Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 4,309 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
// Ignore unknown commands for extensibility | // Ignore unknown commands for extensibility | ||||
LogPrint(BCLog::NET, "Unknown command \"%s\" from peer=%d\n", | LogPrint(BCLog::NET, "Unknown command \"%s\" from peer=%d\n", | ||||
SanitizeString(msg_type), pfrom.GetId()); | SanitizeString(msg_type), pfrom.GetId()); | ||||
return; | return; | ||||
} | } | ||||
/** | |||||
* Maybe disconnect a peer and discourage future connections from its address. | |||||
* | |||||
* @param[in] pnode The node to check. | |||||
* @return True if the peer was marked for disconnection in this | |||||
* function | |||||
*/ | |||||
bool PeerLogicValidation::MaybeDiscourageAndDisconnect(CNode &pnode) { | bool PeerLogicValidation::MaybeDiscourageAndDisconnect(CNode &pnode) { | ||||
const NodeId peer_id{pnode.GetId()}; | const NodeId peer_id{pnode.GetId()}; | ||||
PeerRef peer = GetPeerRef(peer_id); | PeerRef peer = GetPeerRef(peer_id); | ||||
if (peer == nullptr) { | if (peer == nullptr) { | ||||
return false; | return false; | ||||
} | } | ||||
{ | { | ||||
LOCK(peer->m_misbehavior_mutex); | LOCK(peer->m_misbehavior_mutex); | ||||
▲ Show 20 Lines • Show All 1,119 Lines • Show Last 20 Lines |