v0.2.0 updates
This commit is contained in:
parent
a25d1aa90f
commit
3652e58b7f
33
lib/node.js
33
lib/node.js
@ -82,8 +82,8 @@ function Node()
|
||||
this.blocks = [];
|
||||
|
||||
this._socket = null;
|
||||
this.pendingWatch = false;
|
||||
this.chainWatch = false;
|
||||
this.pendingFilter = false;
|
||||
this.chainFilter = false;
|
||||
this.updateInterval = false;
|
||||
|
||||
socket.on('open', function open() {
|
||||
@ -343,19 +343,18 @@ Node.prototype.setWatches = function()
|
||||
{
|
||||
var self = this;
|
||||
|
||||
// this.pendingWatch = web3.eth.filter('pending');
|
||||
// this.pendingWatch.watch( function(log) {
|
||||
// console.log(log);
|
||||
// // console.log(self.pendingWatch.get());
|
||||
// // console.log('pending changed');
|
||||
// // self.stats.pending = parseInt(log.number);
|
||||
// });
|
||||
this.pendingFilter = web3.eth.filter('pending');
|
||||
this.pendingFilter.watch( function(log) {
|
||||
console.log('pending changed', log);
|
||||
// console.log(self.pendingFilter.get());
|
||||
// self.stats.pending = parseInt(log.number);
|
||||
});
|
||||
|
||||
// this.chainWatch = web3.eth.watch('chain');
|
||||
// this.chainWatch.messages(function(log) {
|
||||
// // console.log('block changed');
|
||||
// self.update();
|
||||
// });
|
||||
this.chainFilter = web3.eth.filter('latest');
|
||||
this.chainFilter.watch(function(log) {
|
||||
console.log('block changed:', log);
|
||||
// self.update();
|
||||
});
|
||||
|
||||
this.updateInterval = setInterval(function(){
|
||||
self.update();
|
||||
@ -390,12 +389,6 @@ Node.prototype.stop = function()
|
||||
clearInterval(this.updateInterval);
|
||||
|
||||
web3.reset();
|
||||
|
||||
// if(this.pendingWatch)
|
||||
// this.pendingWatch.stopWatching();
|
||||
|
||||
// if(this.chainWatch)
|
||||
// this.chainWatch.uninstall();
|
||||
}
|
||||
|
||||
module.exports = Node;
|
Loading…
Reference in New Issue
Block a user