Merge pull request #553 from braydonf/test-timeout

net: clear broadcast timers on pool close
This commit is contained in:
Javed Khan 2018-08-06 22:52:26 +05:30 committed by GitHub
commit 7354fd3377
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -191,6 +191,10 @@ class Pool extends EventEmitter {
async close() { async close() {
assert(this.opened, 'Pool is not open.'); assert(this.opened, 'Pool is not open.');
this.opened = false; this.opened = false;
for (const item of this.invMap.values())
item.resolve();
return this.disconnect(); return this.disconnect();
} }
@ -288,9 +292,6 @@ class Pool extends EventEmitter {
this.disconnecting = true; this.disconnecting = true;
for (const item of this.invMap.values())
item.resolve();
this.peers.destroy(); this.peers.destroy();
this.blockMap.clear(); this.blockMap.clear();

View File

@ -39,14 +39,14 @@
"bmutex": "~0.1.0", "bmutex": "~0.1.0",
"bn.js": "~4.11.8", "bn.js": "~4.11.8",
"bsip": "~0.1.0", "bsip": "~0.1.0",
"bsock": "~0.1.0", "bsock": "~0.1.2",
"bsocks": "~0.2.0", "bsocks": "~0.2.0",
"bstring": "~0.1.0", "bstring": "~0.1.0",
"btcp": "~0.1.0", "btcp": "~0.1.0",
"bufio": "~0.2.0", "bufio": "~0.2.0",
"bupnp": "~0.2.1", "bupnp": "~0.2.1",
"bval": "~0.1.0", "bval": "~0.1.0",
"bweb": "~0.1.1", "bweb": "~0.1.3",
"mrmr": "~0.1.0", "mrmr": "~0.1.0",
"n64": "~0.2.0" "n64": "~0.2.0"
}, },