From b82702393f749deb52181bb56b82aab7fedbbe61 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Tue, 5 Feb 2019 16:44:09 +0000
Subject: [PATCH] NTCP: Speed up allowConnection() (ticket #2381)

---
 .../java/src/net/i2p/router/transport/ntcp/NTCPTransport.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java b/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java
index 321b250cb4..e231d7bbda 100644
--- a/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java
+++ b/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java
@@ -614,7 +614,7 @@ public class NTCPTransport extends TransportImpl {
     }
 
     public boolean allowConnection() {
-        return countActivePeers() < getMaxConnections();
+        return _conByIdent.size() < getMaxConnections();
     }
 
     /** queue up afterSend call, which can take some time w/ jobs, etc */
-- 
GitLab