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 12ace2b commit 72abe72Copy full SHA for 72abe72
src/connection-manager/index.ts
@@ -683,7 +683,15 @@ export class DefaultConnectionManager extends EventEmitter<ConnectionManagerEven
683
684
for (const connection of sortedConnections) {
685
log('too many connections open - closing a connection to %p', connection.remotePeer)
686
- toClose.push(connection)
+ // check allow list
687
+ const connectionInAllowList = this.allow.some((ma) => {
688
+ return ma.getPeerId() === connection.remotePeer.toString()
689
+ })
690
+
691
+ // Connections in the allow list should be excluded from pruning
692
+ if (!connectionInAllowList) {
693
+ toClose.push(connection)
694
+ }
695
696
if (toClose.length === toPrune) {
697
break
0 commit comments