pool: emit blocks and txs event on pool.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
Christopher Jeffrey 2014-05-18 03:58:07 -05:00 committed by Fedor Indutny
parent b041d3ae99
commit 01409b34af
2 changed files with 9 additions and 0 deletions

View File

@ -351,6 +351,7 @@ Peer.prototype._handleInv = function handleInv(items) {
if (txs.length === 0)
return;
this.emit('txs', txs);
this.getData(txs);
};

View File

@ -314,6 +314,14 @@ Pool.prototype._addPeer = function _addPeer(backoff) {
peer.on('addr', function(addr) {
self.emit('addr', addr);
});
peer.on('blocks', function(blocks) {
self.emit('blocks', blocks);
});
peer.on('txs', function(txs) {
self.emit('txs', txs);
});
};
Pool.prototype._removePeer = function _removePeer(peer) {