fix parsed again. emit digest.
This commit is contained in:
parent
effda10901
commit
f8fccb8eaf
@ -205,9 +205,9 @@ bitcoind.on('open', function(status) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test all parsed packets:
|
// Test all digest packets:
|
||||||
if (argv['packets']) {
|
if (argv['packets']) {
|
||||||
bitcoind.on('parsed', function(packet) {
|
bitcoind.on('digest', function(packet) {
|
||||||
return bitcoind.log(packet);
|
return bitcoind.log(packet);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -162,19 +162,19 @@ Bitcoin.prototype.start = function(options, callback) {
|
|||||||
|
|
||||||
if (packet.name === 'addr') {
|
if (packet.name === 'addr') {
|
||||||
self.emit(packet.name, packet.addresses);
|
self.emit(packet.name, packet.addresses);
|
||||||
self.emit('parsed', packet.addresses);
|
self.emit('digest', packet.addresses);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packet.name === 'block') {
|
if (packet.name === 'block') {
|
||||||
var block = self.block(packet.block);
|
var block = self.block(packet.block);
|
||||||
self.emit(packet.name, block);
|
self.emit(packet.name, block);
|
||||||
self.emit('parsed', block);
|
self.emit('digest', block);
|
||||||
block.tx.forEach(function(tx) {
|
block.tx.forEach(function(tx) {
|
||||||
setImmediate(function() {
|
setImmediate(function() {
|
||||||
tx = self.tx(tx);
|
tx = self.tx(tx);
|
||||||
self.emit('tx', tx);
|
self.emit('tx', tx);
|
||||||
self.emit('parsed', tx);
|
self.emit('digest', tx);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -187,15 +187,12 @@ Bitcoin.prototype.start = function(options, callback) {
|
|||||||
name = 'mptx';
|
name = 'mptx';
|
||||||
}
|
}
|
||||||
self.emit(name, tx);
|
self.emit(name, tx);
|
||||||
self.emit('parsed', tx);
|
self.emit('digest', tx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.emit(packet.name, packet);
|
self.emit(packet.name, packet);
|
||||||
self.emit('parsed',
|
self.emit('digest', packet);
|
||||||
packet.addresses
|
|
||||||
|| packet.block
|
|
||||||
|| packet.tx);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, 50);
|
}, 50);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user