diff --git a/lib/node.js b/lib/node.js index 462b806..bb167ca 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(); @@ -419,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(); @@ -433,7 +445,7 @@ Node.prototype.setWatches = function() this.pendingFilter.watch( function(log) { if(PENDING_WORKS) { debounce(function() { - self.update(); + self.updatePending(); }, 50); } });