fix remoteAddress == undefined problem.
This commit is contained in:
parent
4aca23e7e8
commit
6ab0b2636c
@ -430,6 +430,12 @@ Pool.prototype.listen = function listen(callback) {
|
||||
this.server.on('connection', function(socket) {
|
||||
var hostname;
|
||||
|
||||
if (!socket.remoteAddress) {
|
||||
bcoin.debug('Ignoring disconnected leech.');
|
||||
socket.destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.peers.leeches.length >= self.maxLeeches) {
|
||||
hostname = utils.hostname(socket.remoteAddress, socket.remotePort);
|
||||
bcoin.debug('Ignoring leech: too many leeches (%s).', hostname);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user