Skip to content

Commit

Permalink
net: Switch to DisconnectMsg in CConnman
Browse files Browse the repository at this point in the history
  • Loading branch information
hodlinator committed Jan 2, 2025
1 parent 406b56c commit cf3b99f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3608,7 +3608,7 @@ bool CConnman::DisconnectNode(const std::string& strNode)
{
LOCK(m_nodes_mutex);
if (CNode* pnode = FindNode(strNode)) {
LogDebug(BCLog::NET, "disconnect by address%s matched peer=%d; disconnecting\n", (fLogIPs ? strprintf("=%s", strNode) : ""), pnode->GetId());
LogDebug(BCLog::NET, "disconnect by address%s match; %s", (fLogIPs ? strprintf("=%s", strNode) : ""), pnode->DisconnectMsg(fLogIPs));
pnode->fDisconnect = true;
return true;
}
Expand All @@ -3621,7 +3621,7 @@ bool CConnman::DisconnectNode(const CSubNet& subnet)
LOCK(m_nodes_mutex);
for (CNode* pnode : m_nodes) {
if (subnet.Match(pnode->addr)) {
LogDebug(BCLog::NET, "disconnect by subnet%s matched peer=%d; disconnecting\n", (fLogIPs ? strprintf("=%s", subnet.ToString()) : ""), pnode->GetId());
LogDebug(BCLog::NET, "disconnect by subnet%s match; %s", (fLogIPs ? strprintf("=%s", subnet.ToString()) : ""), pnode->DisconnectMsg(fLogIPs));
pnode->fDisconnect = true;
disconnected = true;
}
Expand All @@ -3639,7 +3639,7 @@ bool CConnman::DisconnectNode(NodeId id)
LOCK(m_nodes_mutex);
for(CNode* pnode : m_nodes) {
if (id == pnode->GetId()) {
LogDebug(BCLog::NET, "disconnect by id peer=%d; disconnecting\n", pnode->GetId());
LogDebug(BCLog::NET, "disconnect by id; %s", pnode->DisconnectMsg(fLogIPs));
pnode->fDisconnect = true;
return true;
}
Expand Down

0 comments on commit cf3b99f

Please sign in to comment.