[#352] Add explicit max number of alphabet nodes

Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
This commit is contained in:
Alejandro Lopez 2023-05-16 11:22:20 +03:00 committed by Evgenii Stratonikov
parent 13a7a90101
commit df9e099fa7
4 changed files with 41 additions and 10 deletions

View file

@ -39,6 +39,9 @@ func generateAlphabetCreds(cmd *cobra.Command, _ []string) error {
if size == 0 {
return errors.New("size must be > 0")
}
if size > maxAlphabetNodes {
return ErrTooManyAlphabetNodes
}
v := viper.GetViper()
walletDir := config.ResolveHomePath(viper.GetString(alphabetWalletsFlag))