Reduce max wait time to initialize peer connections (#2984)

* Reduce max wait time to initialize peer connections

setting rand time range to 100-300ms instead of 100-800ms

* remove min wait time
This commit is contained in:
Maycon Santos 2024-12-05 13:03:11 +01:00 committed by GitHub
parent 6cfbb1f320
commit e67fe89adb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -597,9 +597,8 @@ func (conn *Conn) doOnConnected(remoteRosenpassPubKey []byte, remoteRosenpassAdd
}
func (conn *Conn) waitInitialRandomSleepTime(ctx context.Context) {
minWait := 100
maxWait := 800
duration := time.Duration(rand.Intn(maxWait-minWait)+minWait) * time.Millisecond
maxWait := 300
duration := time.Duration(rand.Intn(maxWait)) * time.Millisecond
timeout := time.NewTimer(duration)
defer timeout.Stop()