fix: need to store peer, set the id the pass it to onNewPeer

This commit is contained in:
Derrick Hammer 2023-08-31 06:50:24 -04:00
parent 5585907591
commit 7afc759ece
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 4 deletions

View File

@ -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;