Skip to content

Commit

Permalink
only nil the message that errored to send, not all types in the mask
Browse files Browse the repository at this point in the history
  • Loading branch information
jrick committed Dec 31, 2024
1 parent eb71ae0 commit 4d2deec
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions mixing/mixclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,26 +527,21 @@ func (c *Client) sendLocalPeerMsgs(ctx context.Context, s *sessionRun, msgMask u
return msgs[i].t.Before(msgs[j].t)
})

nilPeerMsg := func(p *peer, msgMask uint) {
if msgMask&msgKE == msgKE {
nilPeerMsg := func(p *peer, msg mixing.Message) {
switch msg.(type) {
case *wire.MsgMixKeyExchange:
p.ke = nil
}
if msgMask&msgCT == msgCT {
case *wire.MsgMixCiphertexts:
p.ct = nil
}
if msgMask&msgSR == msgSR {
case *wire.MsgMixSlotReserve:
p.sr = nil
}
if msgMask&msgFP == msgFP {
case *wire.MsgMixFactoredPoly:
p.fp = nil
}
if msgMask&msgDC == msgDC {
case *wire.MsgMixDCNet:
p.dc = nil
}
if msgMask&msgCM == msgCM {
case *wire.MsgMixConfirm:
p.cm = nil
}
if msgMask&msgRS == msgRS {
case *wire.MsgMixSecrets:
p.rs = nil
}
}
Expand All @@ -562,7 +557,7 @@ func (c *Client) sendLocalPeerMsgs(ctx context.Context, s *sessionRun, msgMask u
f: func(p *peer) error {
err := p.signAndSubmit(m.m)
if err != nil {
nilPeerMsg(p, msgMask)
nilPeerMsg(p, m.m)
}
return err
},
Expand Down

0 comments on commit 4d2deec

Please sign in to comment.