Skip to content

Commit

Permalink
wire-mix: more maximums in err msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
jrick committed Nov 21, 2023
1 parent a8eab2d commit ec8885f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion wire/msgmixct.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ func (msg *MsgMixCT) writeMessageNoSignature(op string, w io.Writer, pver uint32
return messageError(op, ErrInvalidMsg, msg)
}
if count > MaxPrevMixMsgs {
msg := fmt.Sprintf("too many previous referenced messages [%v]", count)
msg := fmt.Sprintf("too many previous referenced messages [count %v, max %v]",
count, MaxPrevMixMsgs)
return messageError(op, ErrTooManyPrevMixMsgs, msg)
}

Expand Down
3 changes: 2 additions & 1 deletion wire/msgmixdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ func (msg *MsgMixDC) writeMessageNoSignature(op string, w io.Writer, pver uint32

count := len(msg.SeenSRs)
if count > MaxPrevMixMsgs {
msg := fmt.Sprintf("too many previous referenced messages [%v]", count)
msg := fmt.Sprintf("too many previous referenced messages [count %v, max %v]",
count, MaxPrevMixMsgs)
return messageError(op, ErrTooManyPrevMixMsgs, msg)
}

Expand Down
3 changes: 2 additions & 1 deletion wire/msgmixke.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ func (msg *MsgMixKE) writeMessageNoSignature(op string, w io.Writer, pver uint32
// Limit to max previous messages hashes.
count := len(msg.SeenPRs)
if count > MaxPrevMixMsgs {
msg := fmt.Sprintf("too many previous referenced messages [%v]", count)
msg := fmt.Sprintf("too many previous referenced messages [count %v, max %v]",
count, MaxPrevMixMsgs)
return messageError(op, ErrTooManyPrevMixMsgs, msg)
}

Expand Down
3 changes: 2 additions & 1 deletion wire/msgmixsr.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ func (msg *MsgMixSR) writeMessageNoSignature(op string, w io.Writer, pver uint32

count := len(msg.SeenCTs)
if count > MaxPrevMixMsgs {
msg := fmt.Sprintf("too many previous referenced messages [%v]", count)
msg := fmt.Sprintf("too many previous referenced messages [count %v, max %v]",
count, MaxPrevMixMsgs)
return messageError(op, ErrTooManyPrevMixMsgs, msg)
}

Expand Down

0 comments on commit ec8885f

Please sign in to comment.