pool: graceful disconnect
This commit is contained in:
parent
bae2aa33dd
commit
de36d64d4a
@ -354,6 +354,8 @@ Pool.prototype._disconnect = co(function* disconnect() {
|
|||||||
|
|
||||||
this.peers.destroy();
|
this.peers.destroy();
|
||||||
|
|
||||||
|
this.nonces = new NonceList();
|
||||||
|
|
||||||
this.requestMap.reset();
|
this.requestMap.reset();
|
||||||
|
|
||||||
if (this.pendingFilter != null) {
|
if (this.pendingFilter != null) {
|
||||||
@ -3727,8 +3729,15 @@ PeerList.prototype.destroy = function destroy() {
|
|||||||
|
|
||||||
for (peer = this.list.head; peer; peer = next) {
|
for (peer = this.list.head; peer; peer = next) {
|
||||||
next = peer.next;
|
next = peer.next;
|
||||||
|
|
||||||
|
// stop processing peer events
|
||||||
|
peer.onPacket = null;
|
||||||
|
peer.removeAllListeners()
|
||||||
|
|
||||||
peer.destroy();
|
peer.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.list = new List();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user