mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-13 11:25:02 -05:00
refactor: Rename Node::disconnect methods
Avoid overloading method name to work more easily with IPC framework
This commit is contained in:
parent
77e4b06572
commit
1c2ab1a6d2
3 changed files with 6 additions and 6 deletions
|
@ -152,14 +152,14 @@ public:
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool disconnect(const CNetAddr& net_addr) override
|
bool disconnectByAddress(const CNetAddr& net_addr) override
|
||||||
{
|
{
|
||||||
if (m_context.connman) {
|
if (m_context.connman) {
|
||||||
return m_context.connman->DisconnectNode(net_addr);
|
return m_context.connman->DisconnectNode(net_addr);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool disconnect(NodeId id) override
|
bool disconnectById(NodeId id) override
|
||||||
{
|
{
|
||||||
if (m_context.connman) {
|
if (m_context.connman) {
|
||||||
return m_context.connman->DisconnectNode(id);
|
return m_context.connman->DisconnectNode(id);
|
||||||
|
|
|
@ -124,10 +124,10 @@ public:
|
||||||
virtual bool unban(const CSubNet& ip) = 0;
|
virtual bool unban(const CSubNet& ip) = 0;
|
||||||
|
|
||||||
//! Disconnect node by address.
|
//! Disconnect node by address.
|
||||||
virtual bool disconnect(const CNetAddr& net_addr) = 0;
|
virtual bool disconnectByAddress(const CNetAddr& net_addr) = 0;
|
||||||
|
|
||||||
//! Disconnect node by id.
|
//! Disconnect node by id.
|
||||||
virtual bool disconnect(NodeId id) = 0;
|
virtual bool disconnectById(NodeId id) = 0;
|
||||||
|
|
||||||
//! Get total bytes recv.
|
//! Get total bytes recv.
|
||||||
virtual int64_t getTotalBytesRecv() = 0;
|
virtual int64_t getTotalBytesRecv() = 0;
|
||||||
|
|
|
@ -1191,7 +1191,7 @@ void RPCConsole::disconnectSelectedNode()
|
||||||
// Get currently selected peer address
|
// Get currently selected peer address
|
||||||
NodeId id = nodes.at(i).data().toLongLong();
|
NodeId id = nodes.at(i).data().toLongLong();
|
||||||
// Find the node, disconnect it and clear the selected node
|
// Find the node, disconnect it and clear the selected node
|
||||||
if(m_node.disconnect(id))
|
if(m_node.disconnectById(id))
|
||||||
clearSelectedNode();
|
clearSelectedNode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1216,7 +1216,7 @@ void RPCConsole::banSelectedNode(int bantime)
|
||||||
const CNodeCombinedStats *stats = clientModel->getPeerTableModel()->getNodeStats(detailNodeRow);
|
const CNodeCombinedStats *stats = clientModel->getPeerTableModel()->getNodeStats(detailNodeRow);
|
||||||
if (stats) {
|
if (stats) {
|
||||||
m_node.ban(stats->nodeStats.addr, BanReasonManuallyAdded, bantime);
|
m_node.ban(stats->nodeStats.addr, BanReasonManuallyAdded, bantime);
|
||||||
m_node.disconnect(stats->nodeStats.addr);
|
m_node.disconnectByAddress(stats->nodeStats.addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clearSelectedNode();
|
clearSelectedNode();
|
||||||
|
|
Loading…
Add table
Reference in a new issue