From 9fce5d3ba3ecf6664c48eb279073e40b90f4c2a0 Mon Sep 17 00:00:00 2001 From: cubedro Date: Tue, 2 Jun 2015 17:15:34 +0300 Subject: [PATCH] fixed duplicate pending sends --- lib/node.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/node.js b/lib/node.js index a9b89c4..e458ae7 100644 --- a/lib/node.js +++ b/lib/node.js @@ -97,7 +97,7 @@ function Node () this._lastBlock = 0; this._lastStats = JSON.stringify(this.stats); this._lastFetch = 0; - this._startBlockFetch = 0; + this._lastPending = 0; this._tries = 0; this._down = 0; @@ -533,7 +533,10 @@ Node.prototype.getPending = function() self.stats.pending = pending; - self.sendPendingUpdate(); + if(self._lastPending !== pending) + self.sendPendingUpdate(); + + self._lastPending = pending; }); } }