peer: kill unresponsive peers.
This commit is contained in:
parent
6dfe8c59eb
commit
60c64a6eba
@ -654,13 +654,14 @@ Peer.prototype.sendVersion = function sendVersion() {
|
|||||||
|
|
||||||
Peer.prototype.sendPing = function sendPing() {
|
Peer.prototype.sendPing = function sendPing() {
|
||||||
if (!this.version)
|
if (!this.version)
|
||||||
return;
|
return Promise.resolve();
|
||||||
|
|
||||||
if (this.version.version <= 60000)
|
if (this.version.version <= 60000)
|
||||||
return this.send(new packets.PingPacket());
|
return this.send(new packets.PingPacket());
|
||||||
|
|
||||||
if (this.challenge) {
|
if (this.challenge) {
|
||||||
this.logger.debug('Peer has not responded to ping (%s).', this.hostname);
|
this.logger.debug('Peer has not responded to ping (%s).', this.hostname);
|
||||||
|
this.destroy();
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user