pool: when proxying peer->pool events. pass peer as the 2nd arg.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
Christopher Jeffrey 2014-05-18 03:59:09 -05:00 committed by Fedor Indutny
parent 01409b34af
commit 2ab9334b4b

View File

@ -289,13 +289,13 @@ Pool.prototype._addPeer = function _addPeer(backoff) {
self._response(block);
self.chain.add(block);
self.emit('chain-progress', self.chain.fillPercent());
self.emit('block', block);
self.emit('chain-progress', self.chain.fillPercent(), peer);
self.emit('block', block, peer);
});
// Just FYI
peer.on('reject', function(payload) {
self.emit('reject', payload);
self.emit('reject', payload, peer);
});
peer.on('notfound', function(items) {
@ -308,19 +308,19 @@ Pool.prototype._addPeer = function _addPeer(backoff) {
peer.on('tx', function(tx) {
self._response(tx);
self.emit('tx', tx);
self.emit('tx', tx, peer);
});
peer.on('addr', function(addr) {
self.emit('addr', addr);
self.emit('addr', addr, peer);
});
peer.on('blocks', function(blocks) {
self.emit('blocks', blocks);
self.emit('blocks', blocks, peer);
});
peer.on('txs', function(txs) {
self.emit('txs', txs);
self.emit('txs', txs, peer);
});
};