improved pending tx

This commit is contained in:
cubedro 2015-04-07 19:46:05 +03:00
parent 2fcba72bcc
commit 645912a086
1 changed files with 14 additions and 1 deletions

View File

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