removed latest filter

This commit is contained in:
cubedro 2015-04-28 08:38:37 +03:00
parent ef17dec195
commit 2ac7cba9f4

View File

@ -40,7 +40,7 @@ var socket = new Socket(process.env.WS_SERVER || 'ws://localhost:3000');
var WS_SECRET = process.env.WS_SECRET || "eth-net-stats-has-a-secret";
var PENDING_WORKS = true;
var MAX_BLOCKS_HISTORY = 36;
var MAX_BLOCKS_HISTORY = 40;
var UPDATE_INTERVAL = 5000;
var PING_INTERVAL = 2000;
var MINERS_LIMIT = 5;
@ -514,32 +514,32 @@ Node.prototype.setWatches = function()
console.error(err);
}
try {
this.chainFilter = web3.eth.filter('latest');
this.chainFilter.watch(function(log)
{
var now = (new Date()).getTime();
var time = now - self._lastLatestLog;
// try {
// this.chainFilter = web3.eth.filter('latest');
// this.chainFilter.watch(function(log)
// {
// var now = (new Date()).getTime();
// var time = now - self._lastLatestLog;
if(time > 50)
{
self.update();
}
else
{
debounce(function() {
self.update();
}, 50);
}
// if(time > 50)
// {
// self.update();
// }
// else
// {
// debounce(function() {
// self.update();
// }, 50);
// }
self._lastLatestLog = now;
});
}
catch (err)
{
console.error("Couldn't set up chain filter");
console.error(err);
}
// self._lastLatestLog = now;
// });
// }
// catch (err)
// {
// console.error("Couldn't set up chain filter");
// console.error(err);
// }
this.updateInterval = setInterval(function(){
self.update();