Skip to content

Commit

Permalink
select on cancellation and send delay
Browse files Browse the repository at this point in the history
  • Loading branch information
jrick committed Dec 31, 2024
1 parent 0b923ed commit 20997c8
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions mixing/mixclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,17 +567,11 @@ func (c *Client) sendLocalPeerMsgs(ctx context.Context, deadline time.Time, s *s

for i := range msgs {
m := msgs[i]
if sessionCancelled() {
continue
}
if err := m.p.ctx.Err(); err != nil {
nilPeerMsg(m.p, m.m)
errs = append(errs, err)
continue
}
time.Sleep(time.Until(m.sendTime))
if sessionCancelled() {
select {
case <-ctx.Done():
sessionCancelled()
continue
case <-time.After(time.Until(m.sendTime)):
}
// TODO: handle send deadline in wallet.SubmitMixMessage.
if time.Now().After(m.deadline) {
Expand Down

0 comments on commit 20997c8

Please sign in to comment.