Skip to content

Commit

Permalink
fixed nil check on nodes in DKG (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
CluEleSsUK authored Feb 7, 2024
1 parent 080efbe commit ef24d7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions share/dkg/dkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ type DistKeyGenerator struct {
// NewDistKeyHandler takes a Config and returns a DistKeyGenerator that is able
// to drive the DKG or resharing protocol.
func NewDistKeyHandler(c *Config) (*DistKeyGenerator, error) {
if c.NewNodes == nil && c.OldNodes == nil {
if len(c.NewNodes) == 0 && len(c.OldNodes) == 0 {
return nil, errors.New("dkg: can't run with empty node list")
}
if len(c.Nonce) != NonceLength {
Expand All @@ -207,7 +207,7 @@ func NewDistKeyHandler(c *Config) (*DistKeyGenerator, error) {
isResharing = true
}
if isResharing {
if c.OldNodes == nil {
if len(c.OldNodes) == 0 {
return nil, errors.New("dkg: resharing config needs old nodes list")
}
if c.OldThreshold == 0 {
Expand Down

0 comments on commit ef24d7e

Please sign in to comment.