From 7afc759ece228b148f56d0e3203f0406f4820ffa Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 31 Aug 2023 06:50:24 -0400 Subject: [PATCH] fix: need to store peer, set the id the pass it to onNewPeer --- src/service/p2p.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/service/p2p.ts b/src/service/p2p.ts index 419eebe..a2775c2 100644 --- a/src/service/p2p.ts +++ b/src/service/p2p.ts @@ -319,10 +319,10 @@ export class P2PService { this.logger.verbose(`[connect] ${connectionUri}`); const socket = await createTransportSocket(protocol, connectionUri); - await this.onNewPeer( - createTransportPeer(protocol, socket, [connectionUri]), - true, - ); + const peer = createTransportPeer(protocol, socket, [connectionUri]); + + peer.id = id; + await this.onNewPeer(peer, true); } catch (e) { if (retried) { return;