Merge pull request #61 from cubedro/develop

Improvements
This commit is contained in:
Marian OANCΞA 2015-04-07 19:47:08 +03:00
commit e25821ef19
1 changed files with 14 additions and 2 deletions

View File

@ -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);
}
});