From ab69f0fb4d85e7a133c87138953b3975bec20f8b Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 2 Oct 2018 14:36:12 -0700 Subject: [PATCH] take the pinlock when updating pins License: MIT Signed-off-by: Steven Allen --- core/coreapi/pin.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/coreapi/pin.go b/core/coreapi/pin.go index c99224cb0..0452c3759 100644 --- a/core/coreapi/pin.go +++ b/core/coreapi/pin.go @@ -67,6 +67,8 @@ func (api *PinAPI) Update(ctx context.Context, from coreiface.Path, to coreiface return err } + defer api.node.Blockstore.PinLock().Unlock() + fp, err := api.core().ResolvePath(ctx, from) if err != nil { return err