pool: graceful disconnect

This commit is contained in:
Mokhtar Naamani 2017-01-26 18:19:55 +02:00
parent bae2aa33dd
commit de36d64d4a

View File

@ -354,6 +354,8 @@ Pool.prototype._disconnect = co(function* disconnect() {
this.peers.destroy();
this.nonces = new NonceList();
this.requestMap.reset();
if (this.pendingFilter != null) {
@ -3727,8 +3729,15 @@ PeerList.prototype.destroy = function destroy() {
for (peer = this.list.head; peer; peer = next) {
next = peer.next;
// stop processing peer events
peer.onPacket = null;
peer.removeAllListeners()
peer.destroy();
}
this.list = new List();
};
/**