Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
fix: fix race on "responsive" check
Browse files Browse the repository at this point in the history
fixes #527
  • Loading branch information
Stebalien committed Sep 2, 2021
1 parent 6dce2a1 commit e7f60bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion network/connecteventmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ func (c *connectEventManager) OnMessage(p peer.ID) {
// we need to modify state
c.lk.RLock()
state, ok := c.conns[p]
responsive := ok && state.responsive
c.lk.RUnlock()

if !ok || state.responsive {
if !ok || responsive {
return
}

Expand Down

0 comments on commit e7f60bf

Please sign in to comment.