From 0629cffa6d4efdf04e3ce6f754500bdcdd51eeaf Mon Sep 17 00:00:00 2001 From: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> Date: Tue, 3 Nov 2020 15:29:31 +0800 Subject: [PATCH 1/2] style: make error handlings styke more consistent error handlings in other places are of different style. This PR aims to make the error handling style more consistent --- ecdsa/keygen/round_3.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ecdsa/keygen/round_3.go b/ecdsa/keygen/round_3.go index c7b89ac7..415ab75d 100644 --- a/ecdsa/keygen/round_3.go +++ b/ecdsa/keygen/round_3.go @@ -114,10 +114,9 @@ func (round *round3) Start() *tss.Error { var multiErr error if len(culprits) > 0 { for _, vssResult := range vssResults { - if vssResult.unWrappedErr == nil { - continue + if vssResult.unWrappedErr != nil { + multiErr = multierror.Append(multiErr, vssResult.unWrappedErr) } - multiErr = multierror.Append(multiErr, vssResult.unWrappedErr) } return round.WrapError(multiErr, culprits...) } From e0e429990033eaac008f51de367fc6708e9fd2a9 Mon Sep 17 00:00:00 2001 From: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> Date: Tue, 3 Nov 2020 15:33:13 +0800 Subject: [PATCH 2/2] apply to eddsa --- eddsa/keygen/round_3.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/eddsa/keygen/round_3.go b/eddsa/keygen/round_3.go index 2b219a99..e0c3818c 100644 --- a/eddsa/keygen/round_3.go +++ b/eddsa/keygen/round_3.go @@ -124,10 +124,9 @@ func (round *round3) Start() *tss.Error { var multiErr error if len(culprits) > 0 { for _, vssResult := range vssResults { - if vssResult.unWrappedErr == nil { - continue + if vssResult.unWrappedErr != nil { + multiErr = multierror.Append(multiErr, vssResult.unWrappedErr) } - multiErr = multierror.Append(multiErr, vssResult.unWrappedErr) } return round.WrapError(multiErr, culprits...) }