diff options
| author | Pieter Wuille <[email protected]> | 2020-06-10 17:11:38 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2020-07-03 20:43:55 -0700 |
| commit | 2ad58381fffb33d611abf900b73d9e6b5a4e35f8 (patch) | |
| tree | 8794dd741e4616bcf129da6e274a822a9952e53b /src/rpc/net.cpp | |
| parent | Replace automatic bans with discouragement filter (diff) | |
| download | discoin-2ad58381fffb33d611abf900b73d9e6b5a4e35f8.tar.xz discoin-2ad58381fffb33d611abf900b73d9e6b5a4e35f8.zip | |
Clean up separated ban/discourage interface
Diffstat (limited to 'src/rpc/net.cpp')
| -rw-r--r-- | src/rpc/net.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index c0738152d..393442e94 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -601,8 +601,7 @@ static UniValue setban(const JSONRPCRequest& request) if (strCommand == "add") { - if ((isSubnet && node.banman->IsBanned(subNet)) || - (!isSubnet && node.banman->IsBannedLevel(netAddr) == BanReasonManuallyAdded)) { + if (isSubnet ? node.banman->IsBanned(subNet) : node.banman->IsBanned(netAddr)) { throw JSONRPCError(RPC_CLIENT_NODE_ALREADY_ADDED, "Error: IP/Subnet already banned"); } @@ -615,12 +614,12 @@ static UniValue setban(const JSONRPCRequest& request) absolute = true; if (isSubnet) { - node.banman->Ban(subNet, BanReasonManuallyAdded, banTime, absolute); + node.banman->Ban(subNet, banTime, absolute); if (node.connman) { node.connman->DisconnectNode(subNet); } } else { - node.banman->Ban(netAddr, BanReasonManuallyAdded, banTime, absolute); + node.banman->Ban(netAddr, banTime, absolute); if (node.connman) { node.connman->DisconnectNode(netAddr); } |