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)) {
|
if (this._res(cmd, payload)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (cmd === 'reject')
|
|
||||||
console.log(cmd, payload);
|
|
||||||
this.emit(cmd, payload);
|
this.emit(cmd, payload);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -226,6 +226,11 @@ Pool.prototype._addPeer = function _addPeer() {
|
|||||||
self._response(block);
|
self._response(block);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Just FYI
|
||||||
|
peer.on('reject', function(payload) {
|
||||||
|
self.emit('reject', payload);
|
||||||
|
});
|
||||||
|
|
||||||
peer.on('notfound', function(items) {
|
peer.on('notfound', function(items) {
|
||||||
items.forEach(function(item) {
|
items.forEach(function(item) {
|
||||||
var req = self.request.map[utils.toHex(item.hash)];
|
var req = self.request.map[utils.toHex(item.hash)];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user