changed to pending tx as a separate call

This commit is contained in:
cubedro 2015-06-01 21:43:19 +03:00
parent fe221801a5
commit 781c839dd4

View File

@ -501,19 +501,21 @@ Node.prototype.getPending = function()
{ {
console.info('==>', 'Getting Pending') console.info('==>', 'Getting Pending')
web3.eth.getBlockTransactionCount('pending', function (err, results) web3.eth.getBlockTransactionCount('pending', function (err, pending)
{ {
if (err) { if (err) {
console.error('xx>', 'getPending error: ', err); console.error('xx>', 'getPending error: ', err);
return false; return false;
} }
var results = {};
results.end = _.now(); results.end = _.now();
results.diff = results.end - now; results.diff = results.end - now;
console.success('==>', 'Got getPending results in', chalk.reset.cyan(results.diff, 'ms')); console.success('==>', 'Got getPending results in', chalk.reset.cyan(results.diff, 'ms'));
console.log(pending);
self.stats.pending = results.pending; self.stats.pending = pending;
self.sendPendingUpdate(); self.sendPendingUpdate();
}); });
@ -692,12 +694,12 @@ Node.prototype.setWatches = function()
if(time > 50) if(time > 50)
{ {
self.getStats(true); self.getPending(true);
} }
else else
{ {
debounce(function() { debounce(function() {
self.getStats(true); self.getPending(true);
}, 50); }, 50);
} }
}); });