From 13f96e05e5b7f685e5193605bbef074b87a99742 Mon Sep 17 00:00:00 2001 From: cubedro Date: Sat, 28 Mar 2015 01:28:55 +0200 Subject: [PATCH] fixed recentBlock & increased block history --- lib/node.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/node.js b/lib/node.js index 99d83f4..ebe5325 100644 --- a/lib/node.js +++ b/lib/node.js @@ -30,7 +30,7 @@ if(process.env.NODE_ENV === 'production' && INSTANCE_NAME === "") 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 MAX_BLOCKS_HISTORY = 12; +var MAX_BLOCKS_HISTORY = 36; function Node() { @@ -165,7 +165,7 @@ Node.prototype.getBlock = function(number) try { number = web3.eth.blockNumber; - if(number === this.stats.block.number + 1) + if(number === this.stats.block.number) return this.stats.block; } catch (err) { @@ -343,18 +343,18 @@ Node.prototype.setWatches = function() { var self = this; - this.pendingFilter = web3.eth.filter('pending'); - this.pendingFilter.watch( function(log) { - console.log('pending changed', log); - // console.log(self.pendingFilter.get()); - // self.stats.pending = parseInt(log.number); - }); + // this.pendingFilter = web3.eth.filter('pending'); + // this.pendingFilter.watch( function(log) { + // console.log('pending changed', log); + // // console.log(self.pendingFilter.get()); + // // self.stats.pending = parseInt(log.number); + // }); - this.chainFilter = web3.eth.filter('latest'); - this.chainFilter.watch(function(log) { - console.log('block changed:', log); - // self.update(); - }); + // this.chainFilter = web3.eth.filter('latest'); + // this.chainFilter.watch(function(log) { + // console.log('block changed:', log); + // // self.update(); + // }); this.updateInterval = setInterval(function(){ self.update();