Skip to content

Commit

Permalink
chore: stop and drain timer channel
Browse files Browse the repository at this point in the history
  • Loading branch information
EclesioMeloJunior committed Jan 28, 2022
1 parent 540cb26 commit 92408f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dot/network/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ func (d *discovery) findPeers() {
logger.Tracef("found new peer %s via DHT", peer.ID)
d.h.Peerstore().AddAddrs(peer.ID, peer.Addrs, peerstore.PermanentAddrTTL)
d.handler.AddPeer(0, peer.ID)

if !timer.Stop() {
<-timer.C
}
}
}
}
Expand Down

0 comments on commit 92408f8

Please sign in to comment.