peer/pool: improve handleInv. improve addPeer.
This commit is contained in:
parent
6d2c1bd9f1
commit
024350dbe4
@ -419,9 +419,11 @@ Peer.prototype._handleInv = function handleInv(items) {
|
|||||||
this.emit('blocks', blocks);
|
this.emit('blocks', blocks);
|
||||||
|
|
||||||
if (this.options.satoshi) {
|
if (this.options.satoshi) {
|
||||||
this.getData(items.filter(function(item) {
|
if (txs.length)
|
||||||
return item.type === 'block';
|
this.emit('txs', txs.map(function(tx) {
|
||||||
}));
|
return tx.hash;
|
||||||
|
}));
|
||||||
|
this.getData(items);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -297,7 +297,7 @@ Pool.prototype._addPeer = function _addPeer(backoff) {
|
|||||||
|
|
||||||
if (this.options.satoshi) {
|
if (this.options.satoshi) {
|
||||||
peer.on('block', function(block) {
|
peer.on('block', function(block) {
|
||||||
self.emit('block', block, peer);
|
peer.emit('merkleblock', block);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user