added pending txs

This commit is contained in:
cubedro 2015-03-28 19:46:06 +02:00
parent 0a0e95df13
commit 40951f6301

View File

@ -294,6 +294,7 @@ Node.prototype.getStats = function()
if(this.stats.block.number > 0) if(this.stats.block.number > 0)
this.getLatestBlocks(); this.getLatestBlocks();
self.stats.pending = web3.eth.getBlockTransactionCount('pending');
this.stats.mining = web3.eth.mining; this.stats.mining = web3.eth.mining;
this.stats.gasPrice = web3.eth.gasPrice.toString(10); this.stats.gasPrice = web3.eth.gasPrice.toString(10);
this.stats.listening = web3.net.listening; this.stats.listening = web3.net.listening;
@ -345,14 +346,11 @@ Node.prototype.setWatches = function()
this.pendingFilter = web3.eth.filter('pending'); this.pendingFilter = web3.eth.filter('pending');
this.pendingFilter.watch( function(log) { this.pendingFilter.watch( function(log) {
console.log('pending changed:', log); self.update();
// console.log(self.pendingFilter.get());
// self.stats.pending = parseInt(log.number);
}); });
this.chainFilter = web3.eth.filter('latest'); this.chainFilter = web3.eth.filter('latest');
this.chainFilter.watch(function(log) { this.chainFilter.watch(function(log) {
console.log('block changed:', log);
self.update(); self.update();
}); });