Skip to content

Commit 1c2ab1a

Browse files
committed
refactor: Rename Node::disconnect methods
Avoid overloading method name to work more easily with IPC framework
1 parent 77e4b06 commit 1c2ab1a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/interfaces/node.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ class NodeImpl : public Node
152152
}
153153
return false;
154154
}
155-
bool disconnect(const CNetAddr& net_addr) override
155+
bool disconnectByAddress(const CNetAddr& net_addr) override
156156
{
157157
if (m_context.connman) {
158158
return m_context.connman->DisconnectNode(net_addr);
159159
}
160160
return false;
161161
}
162-
bool disconnect(NodeId id) override
162+
bool disconnectById(NodeId id) override
163163
{
164164
if (m_context.connman) {
165165
return m_context.connman->DisconnectNode(id);

src/interfaces/node.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ class Node
124124
virtual bool unban(const CSubNet& ip) = 0;
125125

126126
//! Disconnect node by address.
127-
virtual bool disconnect(const CNetAddr& net_addr) = 0;
127+
virtual bool disconnectByAddress(const CNetAddr& net_addr) = 0;
128128

129129
//! Disconnect node by id.
130-
virtual bool disconnect(NodeId id) = 0;
130+
virtual bool disconnectById(NodeId id) = 0;
131131

132132
//! Get total bytes recv.
133133
virtual int64_t getTotalBytesRecv() = 0;

src/qt/rpcconsole.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ void RPCConsole::disconnectSelectedNode()
11911191
// Get currently selected peer address
11921192
NodeId id = nodes.at(i).data().toLongLong();
11931193
// Find the node, disconnect it and clear the selected node
1194-
if(m_node.disconnect(id))
1194+
if(m_node.disconnectById(id))
11951195
clearSelectedNode();
11961196
}
11971197
}
@@ -1216,7 +1216,7 @@ void RPCConsole::banSelectedNode(int bantime)
12161216
const CNodeCombinedStats *stats = clientModel->getPeerTableModel()->getNodeStats(detailNodeRow);
12171217
if (stats) {
12181218
m_node.ban(stats->nodeStats.addr, BanReasonManuallyAdded, bantime);
1219-
m_node.disconnect(stats->nodeStats.addr);
1219+
m_node.disconnectByAddress(stats->nodeStats.addr);
12201220
}
12211221
}
12221222
clearSelectedNode();

0 commit comments

Comments
 (0)