cmd/swarm: Make nodekey available for swarm api config

This commit is contained in:
lash 2019-03-21 14:24:21 +01:00
parent 70061520cb
commit 1f097cb946
2 changed files with 3 additions and 3 deletions

View file

@ -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
}

View file

@ -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
}