diff --git a/lib/node.js b/lib/node.js index 9b717ca..860ae14 100644 --- a/lib/node.js +++ b/lib/node.js @@ -708,6 +708,11 @@ Node.prototype.setWatches = function() self.getPending(); } + this._debouncedChain = debounce(function(hash) { + console.info('>>>', 'Debounced'); + self._latestQueue.push(hash); + }, self._chan_min_time); + try { this.chainFilter = web3.eth.filter('latest'); this.chainFilter.watch( function (err, hash) @@ -757,9 +762,7 @@ Node.prototype.setWatches = function() } else { - debounce(function() { - self._latestQueue.push(hash); - }, self._chan_min_time); + self._debouncedChain(hash); } });