pool: some cleanup.
This commit is contained in:
parent
a61679c4a9
commit
394df48408
@ -101,6 +101,7 @@ function Pool(options) {
|
||||
|
||||
this.locker = new Lock(true);
|
||||
this.connected = false;
|
||||
this.disconnecting = false;
|
||||
this.syncing = false;
|
||||
this.spvFilter = null;
|
||||
this.txFilter = null;
|
||||
@ -344,6 +345,8 @@ Pool.prototype._disconnect = co(function* disconnect() {
|
||||
if (!this.connected)
|
||||
return;
|
||||
|
||||
this.disconnecting = true;
|
||||
|
||||
hashes = this.invMap.keys();
|
||||
|
||||
for (i = 0; i < hashes.length; i++) {
|
||||
@ -352,9 +355,6 @@ Pool.prototype._disconnect = co(function* disconnect() {
|
||||
item.resolve();
|
||||
}
|
||||
|
||||
// prevent peer list from trying to refill
|
||||
this.disconnecting = true;
|
||||
|
||||
this.peers.destroy();
|
||||
|
||||
this.requestMap.reset();
|
||||
@ -1156,7 +1156,7 @@ Pool.prototype.handleClose = co(function* handleClose(peer, connected) {
|
||||
if (!outbound)
|
||||
return;
|
||||
|
||||
if(this.disconnecting)
|
||||
if (this.disconnecting)
|
||||
return;
|
||||
|
||||
this.refill();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user