added get pending tx after chain event

This commit is contained in:
cubedro 2015-06-01 22:41:35 +03:00
parent 781c839dd4
commit 5e7c3a3040
1 changed files with 5 additions and 9 deletions

View File

@ -435,10 +435,6 @@ Node.prototype.getStats = function(forced)
{
web3.net.getPeerCount(callback);
},
pending: function (callback)
{
web3.eth.getBlockTransactionCount('pending', callback);
},
mining: function (callback)
{
web3.eth.getMining(callback);
@ -473,7 +469,6 @@ Node.prototype.getStats = function(forced)
{
self.stats.active = true;
self.stats.peers = results.peers;
self.stats.pending = results.pending;
self.stats.mining = results.mining;
self.stats.hashrate = results.hashrate;
self.stats.gasPrice = results.gasPrice.toString(10);
@ -512,8 +507,7 @@ Node.prototype.getPending = function()
results.end = _.now();
results.diff = results.end - now;
console.success('==>', 'Got getPending results in', chalk.reset.cyan(results.diff, 'ms'));
console.log(pending);
console.success('==>', 'Got', chalk.reset.red(pending) , chalk.reset.bold.green('pending tx'+ (pending === 1 ? '' : 's') + ' in'), chalk.reset.cyan(results.diff, 'ms'));
self.stats.pending = pending;
@ -661,6 +655,8 @@ Node.prototype.setWatches = function()
this._latestQueue.drain = function()
{
console.success("Finished processing", 'latest', 'queue');
self.getPending();
}
try {
@ -694,12 +690,12 @@ Node.prototype.setWatches = function()
if(time > 50)
{
self.getPending(true);
self.getPending();
}
else
{
debounce(function() {
self.getPending(true);
self.getPending();
}, 50);
}
});