From 28eb7ac2d661f18451c51b270dd7d3c6907032a7 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 5 Dec 2022 14:32:03 -0500 Subject: [PATCH] *Bug fix heartbeat math --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 15f801c..5c6a6a2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -478,7 +478,7 @@ export default class DHTCache extends EventEmitter { const conn = this.swarm._allConnections.get(pubkey); const online = - conn && heartbeat > 0 && Date.now() - heartbeat > 60 * 1000; + conn && heartbeat > 0 && Date.now() - heartbeat <= 60 * 1000; if (node?.online !== online) { changed = true;