From 58a2c5f8153c5061b3a9e2211cf85144e819c621 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Wed, 7 Dec 2016 16:22:45 -0800 Subject: [PATCH] cmd/ipfs: error out on invalid routing option License: MIT Signed-off-by: Jeromy --- cmd/ipfs/daemon.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 0cc40694138..51864d05a41 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -44,6 +44,7 @@ const ( routingOptionKwd = "routing" routingOptionSupernodeKwd = "supernode" routingOptionDHTClientKwd = "dhtclient" + routingOptionDHTKwd = "dht" unencryptTransportKwd = "disable-transport-encryption" unrestrictedApiAccessKwd = "unrestricted-api" writableKwd = "writable" @@ -328,6 +329,11 @@ func daemonFunc(req cmds.Request, res cmds.Response) { ncfg.Routing = corerouting.SupernodeClient(infos...) case routingOptionDHTClientKwd: ncfg.Routing = core.DHTClientOption + case routingOptionDHTKwd: + ncfg.Routing = core.DHTOption + default: + res.SetError(fmt.Errorf("unrecognized routing option: %s", routingOption), cmds.ErrNormal) + return } node, err := core.NewNode(req.Context(), ncfg)