diff --git a/src/connection.ts b/src/connection.ts index 29ad67b8..40620faf 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -966,6 +966,7 @@ export class Connection extends EventEmitter { } if (!this._destinationAccount) { this.log.debug('not sending because we do not know the client\'s address') + this.safeEmit('_send_loop_finished') return } diff --git a/test/connection.test.ts b/test/connection.test.ts index 630a02fa..28eef09f 100644 --- a/test/connection.test.ts +++ b/test/connection.test.ts @@ -133,6 +133,11 @@ describe('Connection', function () { assert.calledOnce(closeSpy) }) + it('should resolve even if the remote address is unknown', async function () { + delete this.serverConn._destinationAccount + await this.serverConn.end() + }) + it('should close all outgoing streams', async function () { const clientSpy = { stream1: {