diff --git a/src/connection-manager/index.ts b/src/connection-manager/index.ts index fb1e885cfa..7ecf6e6ada 100644 --- a/src/connection-manager/index.ts +++ b/src/connection-manager/index.ts @@ -690,7 +690,15 @@ export class DefaultConnectionManager extends EventEmitter { + return ma.getPeerId() === connection.remotePeer.toString() + }) + + // Connections in the allow list should be excluded from pruning + if (!connectionInAllowList) { + toClose.push(connection) + } if (toClose.length === toPrune) { break