From 7cc2b9f6786f9bc33853220551eed33ca6b7b7b2 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 4 Oct 2017 18:25:34 -0400 Subject: net: Break disconnecting out of Ban() These are separate events which need to be carried out by separate subsystems. This also cleans up some whitespace and tabs in qt to avoid getting flagged by the linter. Current behavior is preserved. --- src/interfaces/node.cpp | 7 +++++++ src/interfaces/node.h | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/interfaces') diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp index acba05fd5e..09460ec43e 100644 --- a/src/interfaces/node.cpp +++ b/src/interfaces/node.cpp @@ -144,6 +144,13 @@ public: } return false; } + bool disconnect(const CNetAddr& net_addr) override + { + if (g_connman) { + return g_connman->DisconnectNode(net_addr); + } + return false; + } bool disconnect(NodeId id) override { if (g_connman) { diff --git a/src/interfaces/node.h b/src/interfaces/node.h index 7fa5958c51..6aa8ce0797 100644 --- a/src/interfaces/node.h +++ b/src/interfaces/node.h @@ -113,7 +113,10 @@ public: //! Unban node. virtual bool unban(const CSubNet& ip) = 0; - //! Disconnect node. + //! Disconnect node by address. + virtual bool disconnect(const CNetAddr& net_addr) = 0; + + //! Disconnect node by id. virtual bool disconnect(NodeId id) = 0; //! Get total bytes recv. -- cgit v1.2.3