Skip to content

Commit

Permalink
Use most recent (fewest-PR) KEs to form alt sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
jrick committed Jul 8, 2024
1 parent 9731e3b commit bb14d26
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mixing/mixclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ func (c *Client) alternateSession(pairing []byte, prs []*wire.MsgMixPairReq, d *
kes := c.mixpool.ReceiveKEsByPairing(pairing, unixEpoch)

// Sort KEs by identity first (just to group these together) followed
// by the total referenced PR counts in decreasing order.
// by the total referenced PR counts in increasing order.
// When ranging over KEs below, this will allow us to consider the
// order in which other peers created their KEs, and how they are
// forming their sessions.
Expand All @@ -1918,7 +1918,7 @@ func (c *Client) alternateSession(pairing []byte, prs []*wire.MsgMixPairReq, d *
if bytes.Compare(a.Identity[:], b.Identity[:]) == -1 {
return true
}
if len(a.SeenPRs) > len(b.SeenPRs) {
if len(a.SeenPRs) < len(b.SeenPRs) {
return true
}
return false
Expand All @@ -1931,7 +1931,7 @@ func (c *Client) alternateSession(pairing []byte, prs []*wire.MsgMixPairReq, d *
prHashByIdentity[pr.Identity] = pr.Hash()
}

// Only one KE per peer identity (the KE that references the most PR
// Only one KE per peer identity (the KE that references the least PR
// hashes) is used for determining session agreement.
type peerMsgs struct {
pr *wire.MsgMixPairReq
Expand Down

0 comments on commit bb14d26

Please sign in to comment.