MCPcopy Create free account
hub / github.com/chain/Core / backoffDur

Function backoffDur

core/fetch/fetch.go:172–178  ·  view source on GitHub ↗
(n uint)

Source from the content-addressed store, hash-verified

170}
171
172func backoffDur(n uint) time.Duration {
173 if n > 33 {
174 n = 33 // cap to about 10s
175 }
176 d := rand.Int63n(1 << n)
177 return time.Duration(d)
178}
179
180func timeoutBackoffDur(n uint) time.Duration {
181 const baseTimeout = 3 * time.Second

Callers 2

FetchFunction · 0.70
DownloadBlocksFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected