@cryptotaxi247 / kubo / commits / bfdfb8d9c

pin cmd: fix pinLsAll context use

License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>

Łukasz Magiera committed Mar 19, 2018 at 02:02 UTC bfdfb8d9cde906b7d4ed65109448eea28d8c6df6
1 file changed +3 -3
core/commands/pin.go
+3 -3
@@ -307,7 +307,7 @@ Example:
307 if len(req.Arguments()) > 0 {
308 keys, err = pinLsKeys(req.Context(), req.Arguments(), typeStr, n)
309 } else {
310 - keys, err = pinLsAll(typeStr, n)
310 + keys, err = pinLsAll(req.Context(), typeStr, n)
311 }
312
313 if err != nil {
@@ -539,7 +539,7 @@ func pinLsKeys(ctx context.Context, args []string, typeStr string, n *core.IpfsN
539 return keys, nil
540 }
541
542 -func pinLsAll(typeStr string, n *core.IpfsNode) (map[string]RefKeyObject, error) {
542 +func pinLsAll(ctx context.Context, typeStr string, n *core.IpfsNode) (map[string]RefKeyObject, error) {
543
544 keys := make(map[string]RefKeyObject)
545
@@ -557,7 +557,7 @@ func pinLsAll(typeStr string, n *core.IpfsNode) (map[string]RefKeyObject, error)
557 if typeStr == "indirect" || typeStr == "all" {
558 set := cid.NewSet()
559 for _, k := range n.Pinning.RecursiveKeys() {
560 - err := dag.EnumerateChildren(n.Context(), dag.GetLinksWithDAG(n.DAG), k, set.Visit)
560 + err := dag.EnumerateChildren(ctx, dag.GetLinksWithDAG(n.DAG), k, set.Visit)
561 if err != nil {
562 return nil, err
563 }