diff --git a/packages/interface-compliance-tests/src/mocks/connection-manager.ts b/packages/interface-compliance-tests/src/mocks/connection-manager.ts index 6e820543e4..2bea431676 100644 --- a/packages/interface-compliance-tests/src/mocks/connection-manager.ts +++ b/packages/interface-compliance-tests/src/mocks/connection-manager.ts @@ -97,6 +97,10 @@ class MockConnectionManager implements ConnectionManager, Startable { return map } + getMaxConnections (): number { + return 10_000 + } + async openConnection (peerId: PeerId | Multiaddr | Multiaddr[]): Promise { if (isMultiaddr(peerId)) { throw new UnsupportedOperationError('Dialing multiaddrs not supported') diff --git a/packages/interface-internal/src/connection-manager/index.ts b/packages/interface-internal/src/connection-manager/index.ts index de9d036e08..adb7ff04b6 100644 --- a/packages/interface-internal/src/connection-manager/index.ts +++ b/packages/interface-internal/src/connection-manager/index.ts @@ -46,6 +46,12 @@ export interface ConnectionManager { */ getConnectionsMap(): PeerMap + /** + * Returns the configured maximum number of connections this connection + * manager will accept + */ + getMaxConnections(): number + /** * Open a connection to a remote peer *