*Refactor so if we emit heart beat we treat it like we added a peer then set the timestamp after, in case the peer is disconnected on one side or to handle unknown unknowns
This commit is contained in:
parent
fbbc2a2e71
commit
57d35e77fc
|
@ -324,7 +324,10 @@ export default class DHTCache extends EventEmitter {
|
|||
return;
|
||||
}
|
||||
|
||||
this._addEntityConnection(id, bufId as Buffer);
|
||||
this.addPeerHandler({
|
||||
remotePublicKey: id,
|
||||
});
|
||||
|
||||
this._setEntity(bufId as Buffer, { heartbeat: Date.now() });
|
||||
|
||||
this.log.debug(`Heartbeat received from ${bufId.toString("hex")}`);
|
||||
|
|
Loading…
Reference in New Issue