peer/pool: improve handleInv. improve addPeer.

This commit is contained in:
Christopher Jeffrey 2014-05-26 04:03:23 -05:00
parent 6d2c1bd9f1
commit 024350dbe4
2 changed files with 6 additions and 4 deletions

View File

@ -419,9 +419,11 @@ Peer.prototype._handleInv = function handleInv(items) {
this.emit('blocks', blocks);
if (this.options.satoshi) {
this.getData(items.filter(function(item) {
return item.type === 'block';
}));
if (txs.length)
this.emit('txs', txs.map(function(tx) {
return tx.hash;
}));
this.getData(items);
return;
}

View File

@ -297,7 +297,7 @@ Pool.prototype._addPeer = function _addPeer(backoff) {
if (this.options.satoshi) {
peer.on('block', function(block) {
self.emit('block', block, peer);
peer.emit('merkleblock', block);
});
}