(n uint)
| 178 | } |
| 179 | |
| 180 | func 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. |