From 6e045d93e4f47ef2de1c9be21ad70927c38a051b Mon Sep 17 00:00:00 2001 From: cubedro Date: Wed, 24 Jun 2015 03:23:28 +0300 Subject: [PATCH] fixed pending debounce function --- lib/node.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/node.js b/lib/node.js index 860ae14..2ca149f 100644 --- a/lib/node.js +++ b/lib/node.js @@ -713,6 +713,10 @@ Node.prototype.setWatches = function() self._latestQueue.push(hash); }, self._chan_min_time); + this._debouncedPending = debounce(function() { + self.getPending(); + }, 5); + try { this.chainFilter = web3.eth.filter('latest'); this.chainFilter.watch( function (err, hash) @@ -792,9 +796,7 @@ Node.prototype.setWatches = function() } else { - debounce(function() { - self.getPending(); - }, 5); + self._debouncedPending(); } });