diff --git a/lib/p2p/Pool.ts b/lib/p2p/Pool.ts index 62f260f77..c412315e0 100644 --- a/lib/p2p/Pool.ts +++ b/lib/p2p/Pool.ts @@ -457,8 +457,9 @@ class Pool extends EventEmitter { private addressIsSelf = (address: Address): boolean => { if (address.port === this.listenPort) { switch (address.host) { - case '::1': + case '::': case '0.0.0.0': + case '::1': case '127.0.0.1': case 'localhost': return true; diff --git a/test/jest/Pool.spec.ts b/test/jest/Pool.spec.ts index e3d491357..62be0eba2 100644 --- a/test/jest/Pool.spec.ts +++ b/test/jest/Pool.spec.ts @@ -127,8 +127,9 @@ describe('P2P Pool', () => { test('should reject connecting to its own addresses', async () => { const selfAddresses = [ - '::1', + '::', '0.0.0.0', + '::1', '127.0.0.1', 'localhost', ];