aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authornicolas.dorier <nicolas.dorier@gmail.com>2019-08-15 16:34:52 +0900
committernicolas.dorier <nicolas.dorier@gmail.com>2019-08-15 22:40:32 +0900
commitdc7529abf0197dccb876dc4a93cbdd2ad9f03e5c (patch)
treeaab9946044dae6258d1e82c6cf8c945679a90951 /src/net.cpp
parent8fc7f0cba9b1b60ce25d6a8ba51052af1461f825 (diff)
[Fix] Allow connection of a noban banned peer
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 0464a6e9ea..0391edadaa 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -906,7 +906,6 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
NetPermissionFlags permissionFlags = NetPermissionFlags::PF_NONE;
hListenSocket.AddSocketPermissionFlags(permissionFlags);
AddWhitelistPermissionFlags(permissionFlags, addr);
- const bool noban = NetPermissions::HasFlag(permissionFlags, NetPermissionFlags::PF_NOBAN);
bool legacyWhitelisted = false;
if (NetPermissions::HasFlag(permissionFlags, NetPermissionFlags::PF_ISIMPLICIT)) {
NetPermissions::ClearFlag(permissionFlags, PF_ISIMPLICIT);
@@ -953,7 +952,7 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
// Don't accept connections from banned peers, but if our inbound slots aren't almost full, accept
// if the only banning reason was an automatic misbehavior ban.
- if (!noban && bannedlevel > ((nInbound + 1 < nMaxInbound) ? 1 : 0))
+ if (!NetPermissions::HasFlag(permissionFlags, NetPermissionFlags::PF_NOBAN) && bannedlevel > ((nInbound + 1 < nMaxInbound) ? 1 : 0))
{
LogPrint(BCLog::NET, "connection from %s dropped (banned)\n", addr.ToString());
CloseSocket(hSocket);