We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cccd34e commit 1c3484bCopy full SHA for 1c3484b
src/connection-manager/index.ts
@@ -671,7 +671,15 @@ export class DefaultConnectionManager extends EventEmitter<ConnectionManagerEven
671
672
for (const connection of sortedConnections) {
673
log('too many connections open - closing a connection to %p', connection.remotePeer)
674
- toClose.push(connection)
+ // check allow list
675
+ const connectionInAllowList = this.allow.some((ma) => {
676
+ return ma.getPeerId() === connection.remotePeer.toString()
677
+ })
678
+
679
+ // Connections in the allow list should be excluded from pruning
680
+ if (!connectionInAllowList) {
681
+ toClose.push(connection)
682
+ }
683
684
if (toClose.length === toPrune) {
685
break
0 commit comments