*On connect message, ensure both entities exist as peers

This commit is contained in:
Derrick Hammer 2022-12-17 13:06:56 -05:00
parent 9dc698e744
commit 045577cdec
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 0 deletions

View File

@ -286,6 +286,8 @@ export default class DHTCache extends EventEmitter {
const { id: toId } = decoded;
let bufId = b4a.from(toId as Uint8Array) as Buffer;
this._ensurePeer(id);
this._ensurePeer(bufId);
this._addEntityConnection(id, bufId);
this.emit("peer-add-seen", id, bufId);
this._recalculate();