[#1167] adm/morph: Move literal to const

Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
pull/1174/head
Alexander Chuprov 2024-06-07 16:33:03 +03:00 committed by Evgenii Stratonikov
parent d4f425f86a
commit 41e670c9ba
1 changed files with 5 additions and 3 deletions

View File

@ -137,6 +137,8 @@ func SetConfigCmd(cmd *cobra.Command, args []string) error {
return wCtx.AwaitTx()
}
const maxECSum = 256
func validateConfig(args map[string]any, forceFlag bool) error {
var sumEC int64
_, okData := args[netmap.MaxECDataCountConfig]
@ -172,9 +174,9 @@ func validateConfig(args map[string]any, forceFlag bool) error {
}
}
if sumEC > 256 && !forceFlag {
return fmt.Errorf("the sum of %s and %s must be <= 256, got %d",
netmap.MaxECDataCountConfig, netmap.MaxECParityCountConfig, sumEC)
if sumEC > maxECSum && !forceFlag {
return fmt.Errorf("the sum of %s and %s must be <= %d, got %d",
netmap.MaxECDataCountConfig, netmap.MaxECParityCountConfig, maxECSum, sumEC)
}
return nil
}