diff --git a/mixing/mixclient/client.go b/mixing/mixclient/client.go index ff6fac9f8..1bac640d5 100644 --- a/mixing/mixclient/client.go +++ b/mixing/mixclient/client.go @@ -516,11 +516,11 @@ func (c *Client) prDelay(ctx context.Context, p *peer) error { sendBefore := epoch.Add(-timeoutDuration - maxJitter) sendAfter := epoch.Add(timeoutDuration) var wait time.Duration - if now.After(sendBefore) { + if now.Equal(sendBefore) || now.After(sendBefore) { wait = sendAfter.Sub(now) sendBefore = sendBefore.Add(c.epoch) } - wait += p.msgJitter() + rand.Duration(time.Until(sendBefore)) + wait += p.msgJitter() + rand.Duration(sendBefore.Sub(now)) timer := time.NewTimer(wait) select { case <-ctx.Done():