use the heartbeat interval for slack time
This commit is contained in:
parent
f2c25c2228
commit
8c08ebaecb
|
@ -118,10 +118,6 @@ var (
|
||||||
// before attempting to re-graft.
|
// before attempting to re-graft.
|
||||||
GossipSubPruneBackoff = time.Minute
|
GossipSubPruneBackoff = time.Minute
|
||||||
|
|
||||||
// GossipSubPruneBackoffSlack is the slack time after expiry of a backoff and before
|
|
||||||
// attempting a GRAFT.
|
|
||||||
GossipSubPruneBackoffSlack = time.Second
|
|
||||||
|
|
||||||
// GossipSubConnectors controls the number of active connection attempts for peers obtained through PX.
|
// GossipSubConnectors controls the number of active connection attempts for peers obtained through PX.
|
||||||
GossipSubConnectors = 8
|
GossipSubConnectors = 8
|
||||||
|
|
||||||
|
@ -1501,7 +1497,7 @@ func (gs *GossipSubRouter) clearBackoff() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
now := time.Now().Add(GossipSubPruneBackoffSlack)
|
now := time.Now().Add(2 * GossipSubHeartbeatInterval)
|
||||||
for topic, backoff := range gs.backoff {
|
for topic, backoff := range gs.backoff {
|
||||||
for p, expire := range backoff {
|
for p, expire := range backoff {
|
||||||
if expire.Before(now) {
|
if expire.Before(now) {
|
||||||
|
|
Loading…
Reference in New Issue