mirror of
https://github.com/status-im/status-go.git
synced 2025-01-17 02:02:36 +00:00
19 lines
284 B
Go
19 lines
284 B
Go
package udp
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
const maxTimeout = 3840 * time.Second
|
|
|
|
func timeout(contiguousTimeouts int) (d time.Duration) {
|
|
if contiguousTimeouts > 8 {
|
|
contiguousTimeouts = 8
|
|
}
|
|
d = 15 * time.Second
|
|
for ; contiguousTimeouts > 0; contiguousTimeouts-- {
|
|
d *= 2
|
|
}
|
|
return
|
|
}
|