diff --git a/cli/wallet/validator.go b/cli/wallet/validator.go index cee1ffaf4..0289ae47c 100644 --- a/cli/wallet/validator.go +++ b/cli/wallet/validator.go @@ -90,7 +90,7 @@ func newValidatorCommands() []cli.Command { } func handleRegister(ctx *cli.Context) error { - return handleCandidate(ctx, "registerCandidate", 1001*100000000) // registering costs 1000 GAS + return handleCandidate(ctx, "registerCandidate", 100000000) // 1 additional GAS. } func handleUnregister(ctx *cli.Context) error { @@ -122,6 +122,14 @@ func handleCandidate(ctx *cli.Context, method string, sysGas int64) error { return cli.NewExitError(err, 1) } + if sysGas >= 0 { + regPrice, err := c.GetCandidateRegisterPrice() + if err != nil { + return cli.NewExitError(err, 1) + } + sysGas += regPrice + } + gas := flags.Fixed8FromContext(ctx, "gas") neoContractHash, err := c.GetNativeContractHash(nativenames.Neo) if err != nil {