improved pending tx
This commit is contained in:
parent
2fcba72bcc
commit
645912a086
15
lib/node.js
15
lib/node.js
@ -418,6 +418,19 @@ Node.prototype.update = function()
|
|||||||
return this.stats;
|
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()
|
Node.prototype.ping = function()
|
||||||
{
|
{
|
||||||
this._latency = (new Date()).getTime();
|
this._latency = (new Date()).getTime();
|
||||||
@ -432,7 +445,7 @@ Node.prototype.setWatches = function()
|
|||||||
this.pendingFilter.watch( function(log) {
|
this.pendingFilter.watch( function(log) {
|
||||||
if(PENDING_WORKS) {
|
if(PENDING_WORKS) {
|
||||||
debounce(function() {
|
debounce(function() {
|
||||||
self.update();
|
self.updatePending();
|
||||||
}, 50);
|
}, 50);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user