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