From 2fcba72bcc48a6d3c2cda7dee4f6df6d0e960433 Mon Sep 17 00:00:00 2001 From: cubedro Date: Tue, 7 Apr 2015 19:37:30 +0300 Subject: [PATCH 1/2] removed listening --- lib/node.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node.js b/lib/node.js index 462b806..09bd420 100644 --- a/lib/node.js +++ b/lib/node.js @@ -376,7 +376,6 @@ Node.prototype.getStats = function() this.stats.mining = web3.eth.mining; this.stats.gasPrice = web3.toBigNumber(web3.eth.gasPrice).toString(10); - this.stats.listening = web3.net.listening; } this.uptime(); From 645912a08660b5fd55b4b7d9b0aede36eeb87aaf Mon Sep 17 00:00:00 2001 From: cubedro Date: Tue, 7 Apr 2015 19:46:05 +0300 Subject: [PATCH 2/2] improved pending tx --- lib/node.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/node.js b/lib/node.js index 09bd420..bb167ca 100644 --- a/lib/node.js +++ b/lib/node.js @@ -418,6 +418,19 @@ Node.prototype.update = function() return this.stats; }; +Node.prototype.updatePending = function() +{ + if(PENDING_WORKS) { + try { + this.stats.pending = web3.eth.getBlockTransactionCount('pending'); + this.sendUpdate(); + } catch (err) { + PENDING_WORKS = false; + console.error("getBlockTransactionCount('pending'):", err); + } + } +} + Node.prototype.ping = function() { this._latency = (new Date()).getTime(); @@ -432,7 +445,7 @@ Node.prototype.setWatches = function() this.pendingFilter.watch( function(log) { if(PENDING_WORKS) { debounce(function() { - self.update(); + self.updatePending(); }, 50); } });