*On connect message, ensure both entities exist as peers
This commit is contained in:
parent
9dc698e744
commit
045577cdec
|
@ -286,6 +286,8 @@ export default class DHTCache extends EventEmitter {
|
||||||
const { id: toId } = decoded;
|
const { id: toId } = decoded;
|
||||||
let bufId = b4a.from(toId as Uint8Array) as Buffer;
|
let bufId = b4a.from(toId as Uint8Array) as Buffer;
|
||||||
|
|
||||||
|
this._ensurePeer(id);
|
||||||
|
this._ensurePeer(bufId);
|
||||||
this._addEntityConnection(id, bufId);
|
this._addEntityConnection(id, bufId);
|
||||||
this.emit("peer-add-seen", id, bufId);
|
this.emit("peer-add-seen", id, bufId);
|
||||||
this._recalculate();
|
this._recalculate();
|
||||||
|
|
Loading…
Reference in New Issue