cli: handle 'name' named argument in 'wallet import-multisig'
If the provided WIF is encrypted, then we won't get account name from readAccountInfo.
This commit is contained in:
parent
6af2f3fdec
commit
08e88ce5b2
1 changed files with 4 additions and 1 deletions
|
@ -173,7 +173,7 @@ func NewCommands() []cli.Command {
|
|||
{
|
||||
Name: "import-multisig",
|
||||
Usage: "import multisig contract",
|
||||
UsageText: "import-multisig --wallet <path> --wif <wif> --min <n>" +
|
||||
UsageText: "import-multisig --wallet <path> --wif <wif> [--name <account_name>] --min <n>" +
|
||||
" [<pubkey1> [<pubkey2> [...]]]",
|
||||
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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue