From c316107c9f7dae5d964399bf8df387f81fea8807 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 31 Aug 2022 13:06:31 +0300 Subject: [PATCH] cli/wallet: avoid parsing address in signStoredTransaction It's not needed, we already have the hash and getDecryptedAccount can't return an account for a different one. --- cli/wallet/multisig.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cli/wallet/multisig.go b/cli/wallet/multisig.go index 2d9f34b2c..35f1a7db7 100644 --- a/cli/wallet/multisig.go +++ b/cli/wallet/multisig.go @@ -8,7 +8,6 @@ import ( "github.com/nspcc-dev/neo-go/cli/options" "github.com/nspcc-dev/neo-go/cli/paramcontext" "github.com/nspcc-dev/neo-go/pkg/core/transaction" - "github.com/nspcc-dev/neo-go/pkg/encoding/address" "github.com/urfave/cli" ) @@ -29,7 +28,9 @@ func signStoredTransaction(ctx *cli.Context) error { if !addrFlag.IsSet { return cli.NewExitError("address was not provided", 1) } - acc, err := getDecryptedAccount(wall, addrFlag.Uint160(), pass) + + var ch = addrFlag.Uint160() + acc, err := getDecryptedAccount(wall, ch, pass) if err != nil { return cli.NewExitError(err, 1) } @@ -39,10 +40,6 @@ func signStoredTransaction(ctx *cli.Context) error { return cli.NewExitError("verifiable item is not a transaction", 1) } - ch, err := address.StringToUint160(acc.Address) - if err != nil { - return cli.NewExitError(fmt.Errorf("wallet contains invalid account: %s", acc.Address), 1) - } signerFound := false for i := range tx.Signers { if tx.Signers[i].Account == ch {