From b7eae36f90f968477ecf1f76172392647db0077f Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Fri, 3 Mar 2017 17:18:57 -0500 Subject: [PATCH] adder: fix bug where errors from calls to NewAdder caused daemon to hang License: MIT Signed-off-by: Kevin Atkinson --- core/commands/add.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/commands/add.go b/core/commands/add.go index 8c88028be..ac655d621 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -202,15 +202,15 @@ You can now refer to the added file in a gateway, like so: bserv := blockservice.New(addblockstore, exch) dserv := dag.NewDAGService(bserv) - outChan := make(chan interface{}, 8) - res.SetOutput((<-chan interface{})(outChan)) - fileAdder, err := coreunix.NewAdder(req.Context(), n.Pinning, n.Blockstore, dserv) if err != nil { res.SetError(err, cmds.ErrNormal) return } + outChan := make(chan interface{}, 8) + res.SetOutput((<-chan interface{})(outChan)) + fileAdder.Out = outChan fileAdder.Chunker = chunker fileAdder.Progress = progress