From 3c63482e5587e0edabb5c215cb6e565ed4f1185e Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Thu, 12 Dec 2024 07:59:23 +0000 Subject: [PATCH] fix: pass abort signal to peer routing query (#2888) Where we fail to find any addresses for a peer id we are dialing, and we perform a routing query to find their addresses, pass the dial abort signal in to the query to ensure it doesn't continue if we are no longer interested in the result. --- packages/libp2p/src/connection-manager/dial-queue.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/libp2p/src/connection-manager/dial-queue.ts b/packages/libp2p/src/connection-manager/dial-queue.ts index 8300905d19..22d092cce0 100644 --- a/packages/libp2p/src/connection-manager/dial-queue.ts +++ b/packages/libp2p/src/connection-manager/dial-queue.ts @@ -349,7 +349,7 @@ export class DialQueue { this.log('looking up multiaddrs for %p in the peer routing', peerId) try { - const peerInfo = await this.components.peerRouting.findPeer(peerId) + const peerInfo = await this.components.peerRouting.findPeer(peerId, options) this.log('found multiaddrs for %p in the peer routing', peerId, addrs.map(({ multiaddr }) => multiaddr.toString()))