From d9ae59f38dbb6909646ac64261e5ef6746ab8c34 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Mon, 5 Mar 2018 19:59:33 +0100 Subject: [PATCH] swarm: use privateKey from Swarm value --- swarm/swarm.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/swarm/swarm.go b/swarm/swarm.go index 2aa2cffb92..28351527d3 100644 --- a/swarm/swarm.go +++ b/swarm/swarm.go @@ -183,7 +183,7 @@ func NewSwarm(ctx *node.ServiceContext, backend chequebook.Backend, config *api. opts := []api.MultiResolverOption{} for _, c := range config.EnsAPIs { tld, endpoint, addr := parseEnsAPIAddress(c) - r, err := newEnsClient(endpoint, addr, config) + r, err := newEnsClient(endpoint, addr, config, self.privateKey) if err != nil { return nil, err } @@ -252,7 +252,7 @@ type ensClient struct { // newEnsClient creates a new ENS client for that is a consumer of // a ENS API on a specific endpoint. It is used as a helper function // for creating multiple resolvers in NewSwarm function. -func newEnsClient(endpoint string, addr common.Address, config *api.Config) (*ensClient, error) { +func newEnsClient(endpoint string, addr common.Address, config *api.Config, privkey *ecdsa.PrivateKey) (*ensClient, error) { log.Info("connecting to ENS API", "url", endpoint) client, err := rpc.Dial(endpoint) if err != nil { @@ -271,7 +271,7 @@ func newEnsClient(endpoint string, addr common.Address, config *api.Config) (*en log.Warn(fmt.Sprintf("could not determine ENS contract address, using default %s", ensRoot), "err", err) } } - transactOpts := bind.NewKeyedTransactor(config.Swap.PrivateKey()) + transactOpts := bind.NewKeyedTransactor(privkey) dns, err := ens.NewENS(transactOpts, ensRoot, ethClient) if err != nil { return nil, err