From 08e88ce5b2c7cf5b8e0c15a5d086163a5f360682 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 19 Apr 2021 17:10:53 +0300 Subject: [PATCH] cli: handle 'name' named argument in 'wallet import-multisig' If the provided WIF is encrypted, then we won't get account name from readAccountInfo. --- cli/wallet/wallet.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/wallet/wallet.go b/cli/wallet/wallet.go index ad7ee8489..ece110e69 100644 --- a/cli/wallet/wallet.go +++ b/cli/wallet/wallet.go @@ -173,7 +173,7 @@ func NewCommands() []cli.Command { { Name: "import-multisig", Usage: "import multisig contract", - UsageText: "import-multisig --wallet --wif --min " + + UsageText: "import-multisig --wallet --wif [--name ] --min " + " [ [ [...]]]", Action: importMultisig, Flags: []cli.Flag{ @@ -410,6 +410,9 @@ func importMultisig(ctx *cli.Context) error { return cli.NewExitError(err, 1) } + if acc.Label == "" { + acc.Label = ctx.String("name") + } if err := addAccountAndSave(wall, acc); err != nil { return cli.NewExitError(err, 1) }