Skip to content

Commit

Permalink
fix(p2p): fix stall timer checks (#2015)
Browse files Browse the repository at this point in the history
This fixes a regression introduced in #1994 that prevents enabling the
stall timer for peers that checks whether peers are not responding to
our packets in a reasonable timeframe and disconnecting those that are
not. Without these checks, peers that have gone offline may remain in
the list of connected peers, resulting in unexpected behavior and also
preventing those peers from establishing new connections with us once
they come back online.

Closes #2010.
  • Loading branch information
sangaman committed Dec 3, 2020
1 parent 360cca7 commit 405f50e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/p2p/Peer.ts
Expand Up @@ -617,7 +617,7 @@ class Peer extends EventEmitter {
}

private initStall = (): void => {
if (this.status !== PeerStatus.Closed) {
if (this.status === PeerStatus.Closed) {
return;
}
assert(!this.stallTimer);
Expand Down

0 comments on commit 405f50e

Please sign in to comment.