re-added pending filter

This commit is contained in:
cubedro 2015-05-05 01:00:01 +03:00
parent 76b4870c90
commit 019507a44f

View File

@ -542,8 +542,6 @@ Node.prototype.updateBlock = function()
{ {
this.getStatsBlock(); this.getStatsBlock();
this.update(true);
return this; return this;
}; };
@ -613,34 +611,34 @@ Node.prototype.setWatches = function()
console.error(err); console.error(err);
} }
// try { try {
// this.pendingFilter = web3.eth.filter('pending'); this.pendingFilter = web3.eth.filter('pending');
// this.pendingFilter.watch( function (log) this.pendingFilter.watch( function (log)
// { {
// var now = _.now(); var now = _.now();
// var time = now - self._lastPendingLog; var time = now - self._lastPendingLog;
// console.log('>>> Pending Filter triggered: ', now); console.log('>>> Pending Filter triggered: ', now);
// if(time > 50) if(time > 50)
// { {
// self.update(); self.update(true);
// } }
// else else
// { {
// debounce(function() { debounce(function() {
// self.update(); self.update(true);
// }, 50); }, 50);
// } }
// self._lastPendingLog = now; self._lastPendingLog = now;
// }); });
// } }
// catch (err) catch (err)
// { {
// console.error("Couldn't set up pending filter"); console.error("Couldn't set up pending filter");
// console.error(err); console.error(err);
// } }
this.updateInterval = setInterval( function(){ this.updateInterval = setInterval( function(){
self.update(); self.update();
@ -678,8 +676,11 @@ Node.prototype.init = function()
// Set filters // Set filters
this.setWatches(); this.setWatches();
// Update stats and send info // Update block and send info
this.updateBlock(); this.updateBlock();
// Update stats and send info
this.update();
} }
Node.prototype.stop = function() Node.prototype.stop = function()