From 79d35baff9ca1791f61058a4e492cac514fa87e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 19 Mar 2018 02:02:18 +0100 Subject: [PATCH] pin cmd: fix pinLsAll context use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Ɓukasz Magiera --- core/commands/pin.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/commands/pin.go b/core/commands/pin.go index 2e2bfab39a3..68a7bdd950d 100644 --- a/core/commands/pin.go +++ b/core/commands/pin.go @@ -307,7 +307,7 @@ Example: if len(req.Arguments()) > 0 { keys, err = pinLsKeys(req.Context(), req.Arguments(), typeStr, n) } else { - keys, err = pinLsAll(typeStr, n) + keys, err = pinLsAll(req.Context(), typeStr, n) } if err != nil { @@ -539,7 +539,7 @@ func pinLsKeys(ctx context.Context, args []string, typeStr string, n *core.IpfsN return keys, nil } -func pinLsAll(typeStr string, n *core.IpfsNode) (map[string]RefKeyObject, error) { +func pinLsAll(ctx context.Context, typeStr string, n *core.IpfsNode) (map[string]RefKeyObject, error) { keys := make(map[string]RefKeyObject) @@ -557,7 +557,7 @@ func pinLsAll(typeStr string, n *core.IpfsNode) (map[string]RefKeyObject, error) if typeStr == "indirect" || typeStr == "all" { set := cid.NewSet() for _, k := range n.Pinning.RecursiveKeys() { - err := dag.EnumerateChildren(n.Context(), dag.GetLinksWithDAG(n.DAG), k, set.Visit) + err := dag.EnumerateChildren(ctx, dag.GetLinksWithDAG(n.DAG), k, set.Visit) if err != nil { return nil, err }