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 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/interfaces/node.cpp') diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp index acba05fd5..09460ec43 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) { -- cgit v1.2.3 From 4c0d961eb0d7825a1e6f8389d7f5545114ee18c6 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 5 Oct 2017 13:10:58 -0400 Subject: banman: create and split out banman Some say he has always been. --- src/interfaces/node.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/interfaces/node.cpp') diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp index 09460ec43..c535b2931 100644 --- a/src/interfaces/node.cpp +++ b/src/interfaces/node.cpp @@ -122,24 +122,24 @@ public: } bool getBanned(banmap_t& banmap) override { - if (g_connman) { - g_connman->GetBanned(banmap); + if (g_banman) { + g_banman->GetBanned(banmap); return true; } return false; } bool ban(const CNetAddr& net_addr, BanReason reason, int64_t ban_time_offset) override { - if (g_connman) { - g_connman->Ban(net_addr, reason, ban_time_offset); + if (g_banman) { + g_banman->Ban(net_addr, reason, ban_time_offset); return true; } return false; } bool unban(const CSubNet& ip) override { - if (g_connman) { - g_connman->Unban(ip); + if (g_banman) { + g_banman->Unban(ip); return true; } return false; -- cgit v1.2.3 From af3503d903b1a608cd212e2d74b274103199078c Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 5 Oct 2017 16:40:43 -0400 Subject: net: move BanMan to its own files --- src/interfaces/node.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/interfaces/node.cpp') diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp index c535b2931..c574f960e 100644 --- a/src/interfaces/node.cpp +++ b/src/interfaces/node.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include -- cgit v1.2.3