pool: emit blocks and txs event on pool.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
parent
b041d3ae99
commit
01409b34af
@ -351,6 +351,7 @@ Peer.prototype._handleInv = function handleInv(items) {
|
|||||||
if (txs.length === 0)
|
if (txs.length === 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
this.emit('txs', txs);
|
||||||
this.getData(txs);
|
this.getData(txs);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -314,6 +314,14 @@ Pool.prototype._addPeer = function _addPeer(backoff) {
|
|||||||
peer.on('addr', function(addr) {
|
peer.on('addr', function(addr) {
|
||||||
self.emit('addr', 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) {
|
Pool.prototype._removePeer = function _removePeer(peer) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user