Skip to content

Commit 801e57f

Browse files
Arachnidzelig
authored andcommitted
cmd/utils: Allow --bzzaccount to specify an account ID or an address
1 parent 4d59db2 commit 801e57f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cmd/utils/flags.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -811,13 +811,13 @@ func MakeSystemNode(name, version string, relconf release.Config, extra []byte,
811811

812812
// bzz. Swarm
813813
var bzzconfig *bzzapi.Config
814-
hexaddr := ctx.GlobalString(SwarmAccountAddrFlag.Name)
815-
if hexaddr != "" {
816-
swarmaccount := common.HexToAddress(hexaddr)
817-
if !accman.HasAddress(swarmaccount) {
818-
Fatalf("swarm account '%v' does not exist: %v", hexaddr, err)
814+
accountid := ctx.GlobalString(SwarmAccountAddrFlag.Name)
815+
if accountid != "" {
816+
swarmaccount, err := MakeAddress(accman, accountid)
817+
if err != nil {
818+
Fatalf("swarm account '%v' does not exist: %v'", accountid, err)
819819
}
820-
prvkey, err := accman.GetUnlocked(swarmaccount)
820+
prvkey, err := accman.GetUnlocked(swarmaccount.Address)
821821
if err != nil {
822822
Fatalf("unable to unlock swarm account: %v", err)
823823
}

0 commit comments

Comments
 (0)