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

Function timeoutBackoffDur

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

Source from the content-addressed store, hash-verified

178}
179
180func timeoutBackoffDur(n uint) time.Duration {
181 const baseTimeout = 3 * time.Second
182 if n > 4 {
183 n = 4 // cap to extra 16s
184 }
185 d := rand.Int63n(int64(time.Second) * (1 << n))
186 return baseTimeout + time.Duration(d)
187}
188
189// getBlock sends a get-block RPC request to another Core
190// for the next block.

Callers 1

DownloadBlocksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected