Merge pull request #198 from cubedro/develop
Fixed chain debounce function
This commit is contained in:
commit
050e086e78
@ -708,6 +708,11 @@ Node.prototype.setWatches = function()
|
|||||||
self.getPending();
|
self.getPending();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._debouncedChain = debounce(function(hash) {
|
||||||
|
console.info('>>>', 'Debounced');
|
||||||
|
self._latestQueue.push(hash);
|
||||||
|
}, self._chan_min_time);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.chainFilter = web3.eth.filter('latest');
|
this.chainFilter = web3.eth.filter('latest');
|
||||||
this.chainFilter.watch( function (err, hash)
|
this.chainFilter.watch( function (err, hash)
|
||||||
@ -757,9 +762,7 @@ Node.prototype.setWatches = function()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
debounce(function() {
|
self._debouncedChain(hash);
|
||||||
self._latestQueue.push(hash);
|
|
||||||
}, self._chan_min_time);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user