From 018c130935e9d5497a62697469194d2daa1c4596 Mon Sep 17 00:00:00 2001 From: cubedro Date: Tue, 2 Jun 2015 13:14:14 +0300 Subject: [PATCH] moved temp chian request in getStats method --- lib/node.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/node.js b/lib/node.js index 5784b38..df5fdf4 100644 --- a/lib/node.js +++ b/lib/node.js @@ -444,6 +444,18 @@ Node.prototype.getStats = function(forced) console.log(' ', 'forced:', chalk.reset.cyan(forced === true)); async.parallel({ + block: function (callback) + { + // TODO: Remove warkaround when web3.js is fixed + if( !self.chainFilter ) + { + console.warn("Getting", chalk.reset.red('latest block'), chalk.reset.bold.red('forced')); + + self.getLatestBlock(); + } + + callback(null, true); + }, peers: function (callback) { web3.net.getPeerCount(callback); @@ -504,14 +516,6 @@ Node.prototype.getPending = function() if (this._web3) { - // TODO: Remove warkaround when web3.js is fixed - if( !this.chainFilter ) - { - console.warn("Getting", chalk.reset.red('latest block'), chalk.reset.bold.red('forced')); - - this.getLatestBlock(); - } - console.info('==>', 'Getting Pending') web3.eth.getBlockTransactionCount('pending', function (err, pending)