peer: proper reporting of reject
This commit is contained in:
parent
f787590efe
commit
403beca64b
@ -252,8 +252,6 @@ Peer.prototype._onPacket = function onPacket(packet) {
|
||||
if (this._res(cmd, payload)) {
|
||||
return;
|
||||
} else {
|
||||
if (cmd === 'reject')
|
||||
console.log(cmd, payload);
|
||||
this.emit(cmd, payload);
|
||||
}
|
||||
};
|
||||
|
||||
@ -226,6 +226,11 @@ Pool.prototype._addPeer = function _addPeer() {
|
||||
self._response(block);
|
||||
});
|
||||
|
||||
// Just FYI
|
||||
peer.on('reject', function(payload) {
|
||||
self.emit('reject', payload);
|
||||
});
|
||||
|
||||
peer.on('notfound', function(items) {
|
||||
items.forEach(function(item) {
|
||||
var req = self.request.map[utils.toHex(item.hash)];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user