diff --git a/lib/net/peer.js b/lib/net/peer.js index 56ead682..9f275f63 100644 --- a/lib/net/peer.js +++ b/lib/net/peer.js @@ -250,6 +250,8 @@ Peer.prototype.bind = function bind(socket) { }); this.socket.once('close', function() { + if (self.destroyed) + return; self.destroy(); self.error('socket hangup'); });