net: revolve pending broadcast items
If `pool.close()` is called if the pool is not connected, timers won't be cleared. Transactions can be added to the pool while it's not connected.
This commit is contained in:
parent
d6c4aa215e
commit
7ea95b5795
@ -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();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user