diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2017-10-04 18:25:34 -0400 |
---|---|---|
committer | Carl Dong <accounts@carldong.me> | 2019-01-16 11:04:05 -0500 |
commit | 7cc2b9f6786f9bc33853220551eed33ca6b7b7b2 (patch) | |
tree | 93ed4cf7b37c8994fefc4fb31eac75acea9f7329 /src/rpc/net.cpp | |
parent | f71c2ea6620a262dd97ba01bdd3dfb3e619cb8cb (diff) |
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.
Diffstat (limited to 'src/rpc/net.cpp')
-rw-r--r-- | src/rpc/net.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 6fdf80dc5f..59bc8e8091 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -565,7 +565,13 @@ static UniValue setban(const JSONRPCRequest& request) if (request.params[3].isTrue()) absolute = true; - isSubnet ? g_connman->Ban(subNet, BanReasonManuallyAdded, banTime, absolute) : g_connman->Ban(netAddr, BanReasonManuallyAdded, banTime, absolute); + if (isSubnet) { + g_connman->Ban(subNet, BanReasonManuallyAdded, banTime, absolute); + g_connman->DisconnectNode(subNet); + } else { + g_connman->Ban(netAddr, BanReasonManuallyAdded, banTime, absolute); + g_connman->DisconnectNode(netAddr); + } } else if(strCommand == "remove") { |