peer: kill unresponsive peers.

This commit is contained in:
Christopher Jeffrey 2016-11-05 09:11:16 -07:00
parent 6dfe8c59eb
commit 60c64a6eba
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -654,13 +654,14 @@ Peer.prototype.sendVersion = function sendVersion() {
Peer.prototype.sendPing = function sendPing() {
if (!this.version)
return;
return Promise.resolve();
if (this.version.version <= 60000)
return this.send(new packets.PingPacket());
if (this.challenge) {
this.logger.debug('Peer has not responded to ping (%s).', this.hostname);
this.destroy();
return Promise.resolve();
}