From 4d2deecfed38b2f8e3f6046de68f2802b98083b5 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Tue, 31 Dec 2024 05:39:06 +0000 Subject: [PATCH] only nil the message that errored to send, not all types in the mask --- mixing/mixclient/client.go | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/mixing/mixclient/client.go b/mixing/mixclient/client.go index 571962b32..720056695 100644 --- a/mixing/mixclient/client.go +++ b/mixing/mixclient/client.go @@ -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 } } @@ -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 },