aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/swarm.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/swarm.go')
-rw-r--r--swarm/swarm.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/swarm/swarm.go b/swarm/swarm.go
index eedac93f3..442e68d51 100644
--- a/swarm/swarm.go
+++ b/swarm/swarm.go
@@ -27,6 +27,7 @@ import (
"github.com/ethereum/go-ethereum/contracts/chequebook"
"github.com/ethereum/go-ethereum/contracts/ens"
"github.com/ethereum/go-ethereum/crypto"
+ "github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
@@ -134,9 +135,13 @@ func NewSwarm(ctx *node.ServiceContext, backend chequebook.Backend, config *api.
// set up high level api
transactOpts := bind.NewKeyedTransactor(self.privateKey)
- self.dns, err = ens.NewENS(transactOpts, config.EnsRoot, self.backend)
- if err != nil {
- return nil, err
+ if backend == (*ethclient.Client)(nil) {
+ log.Warn("No ENS, please specify non-empty --ethapi to use domain name resolution")
+ } else {
+ self.dns, err = ens.NewENS(transactOpts, config.EnsRoot, self.backend)
+ if err != nil {
+ return nil, err
+ }
}
log.Debug(fmt.Sprintf("-> Swarm Domain Name Registrar @ address %v", config.EnsRoot.Hex()))