Merge pull request #156 from cubedro/develop
Added get pending tx after chain event
This commit is contained in:
commit
8c3a02cd56
14
lib/node.js
14
lib/node.js
@ -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);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user