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