pool: minor fixes.

This commit is contained in:
Christopher Jeffrey 2017-01-21 17:27:15 -08:00
parent d516035473
commit 6cca0aac1c
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1114,10 +1114,12 @@ Pool.prototype.handleOpen = co(function* handleOpen(peer) {
// If we don't have an ack'd
// loader yet consider it dead.
if (this.peers.load && !this.peers.load.handshake) {
assert(this.peers.load.loader);
this.peers.load.loader = false;
this.peers.load = null;
if (!peer.loader) {
if (this.peers.load && !this.peers.load.handshake) {
assert(this.peers.load.loader);
this.peers.load.loader = false;
this.peers.load = null;
}
}
// If we do not have a loader,
@ -1147,6 +1149,8 @@ Pool.prototype.handleClose = co(function* handleClose(peer, connected) {
this.resetChain();
}
this.nonces.remove(peer.hostname());
this.emit('peer close', peer, connected);
if (!this.loaded)