config: consolidate ProtocolConfiguration consistency checks
This commit is contained in:
parent
42769d11ff
commit
6e9d725a29
4 changed files with 42 additions and 9 deletions
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/config"
|
||||
|
@ -58,9 +57,6 @@ func validatorsFromConfig(cfg config.ProtocolConfiguration) ([]*keys.PublicKey,
|
|||
}
|
||||
|
||||
func committeeFromConfig(cfg config.ProtocolConfiguration) ([]*keys.PublicKey, error) {
|
||||
if len(cfg.StandbyCommittee) < cfg.ValidatorsCount {
|
||||
return nil, errors.New("validators count can be less than the size of StandbyCommittee")
|
||||
}
|
||||
validators := make([]*keys.PublicKey, len(cfg.StandbyCommittee))
|
||||
for i := range validators {
|
||||
pubKey, err := keys.NewPublicKeyFromString(cfg.StandbyCommittee[i])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue