diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index 3ab34ed5df..32cd442a03 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -123,14 +123,14 @@ func buildConfig(ctx *cli.Context) (config *bzzapi.Config, err error) { } //finally, after the configuration build phase is finished, initialize -func initSwarmNode(config *bzzapi.Config, stack *node.Node, ctx *cli.Context) error { +func initSwarmNode(config *bzzapi.Config, stack *node.Node, ctx *cli.Context, nodeconfig *node.Config) error { //at this point, all vars should be set in the Config //get the account for the provided swarm account prvkey := getAccount(config.BzzAccount, ctx, stack) //set the resolved config path (geth --datadir) config.Path = expandPath(stack.InstanceDir()) //finally, initialize the configuration - err := config.Init(prvkey, stack.Server().PrivateKey) + err := config.Init(prvkey, nodeconfig.NodeKey()) if err != nil { return err } diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index a7b5d400d0..a4041eb3d1 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -298,7 +298,7 @@ func bzzd(ctx *cli.Context) error { //a few steps need to be done after the config phase is completed, //due to overriding behavior - err = initSwarmNode(bzzconfig, stack, ctx) + err = initSwarmNode(bzzconfig, stack, ctx, &cfg) if err != nil { return err }