adder: fix bug where errors from calls to NewAdder caused daemon to hang
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
Kevin Atkinson committed
Mar 3, 2017 at 17:18 UTC
b7eae36f90f968477ecf1f76172392647db0077f
1 file changed
+3
-3
core/commands/add.go
+3
-3
@@ -202,15 +202,15 @@ You can now refer to the added file in a gateway, like so:
202
bserv := blockservice.New(addblockstore, exch)
203
dserv := dag.NewDAGService(bserv)
204
205
- outChan := make(chan interface{}, 8)
206
- res.SetOutput((<-chan interface{})(outChan))
207
-
205
fileAdder, err := coreunix.NewAdder(req.Context(), n.Pinning, n.Blockstore, dserv)
206
if err != nil {
207
res.SetError(err, cmds.ErrNormal)
208
return
209
}
210
211
+ outChan := make(chan interface{}, 8)
212
+ res.SetOutput((<-chan interface{})(outChan))
213
+
214
fileAdder.Out = outChan
215
fileAdder.Chunker = chunker
216
fileAdder.Progress = progress