Skip to content

Commit dc7529a

Browse files
committed
[Fix] Allow connection of a noban banned peer
1 parent 8fc7f0c commit dc7529a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/net.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,6 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
906906
NetPermissionFlags permissionFlags = NetPermissionFlags::PF_NONE;
907907
hListenSocket.AddSocketPermissionFlags(permissionFlags);
908908
AddWhitelistPermissionFlags(permissionFlags, addr);
909-
const bool noban = NetPermissions::HasFlag(permissionFlags, NetPermissionFlags::PF_NOBAN);
910909
bool legacyWhitelisted = false;
911910
if (NetPermissions::HasFlag(permissionFlags, NetPermissionFlags::PF_ISIMPLICIT)) {
912911
NetPermissions::ClearFlag(permissionFlags, PF_ISIMPLICIT);
@@ -953,7 +952,7 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
953952

954953
// Don't accept connections from banned peers, but if our inbound slots aren't almost full, accept
955954
// if the only banning reason was an automatic misbehavior ban.
956-
if (!noban && bannedlevel > ((nInbound + 1 < nMaxInbound) ? 1 : 0))
955+
if (!NetPermissions::HasFlag(permissionFlags, NetPermissionFlags::PF_NOBAN) && bannedlevel > ((nInbound + 1 < nMaxInbound) ? 1 : 0))
957956
{
958957
LogPrint(BCLog::NET, "connection from %s dropped (banned)\n", addr.ToString());
959958
CloseSocket(hSocket);

0 commit comments

Comments
 (0)