fix backoff slack time

This commit is contained in:
vyzo 2020-08-10 14:26:15 +03:00
parent 8c08ebaecb
commit 46536eccc4
1 changed files with 3 additions and 2 deletions

View File

@ -1497,10 +1497,11 @@ func (gs *GossipSubRouter) clearBackoff() {
return
}
now := time.Now().Add(2 * GossipSubHeartbeatInterval)
now := time.Now()
for topic, backoff := range gs.backoff {
for p, expire := range backoff {
if expire.Before(now) {
// add some slack time to the expiration
if expire.Add(2 * GossipSubHeartbeatInterval).Before(now) {
delete(backoff, p)
}
}