From c53b7d39f7366427b21016474d8c5dce7a4ffd65 Mon Sep 17 00:00:00 2001
From: Steven Allen <steven@stebalien.com>
Date: Tue, 8 Oct 2019 16:50:24 +0900
Subject: [PATCH] fix(pin): wait till after fetching to remove direct pin

Otherwise, we could abort while fetching the graph and stay in a state where the
direct pin is removed.

fixes #4650
---
 pin.go | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/pin.go b/pin.go
index 975245e..63fa663 100644
--- a/pin.go
+++ b/pin.go
@@ -225,9 +225,6 @@ func (p *pinner) Pin(ctx context.Context, node ipld.Node, recurse bool) error {
 			return nil
 		}
 
-		if p.directPin.Has(c) {
-			p.directPin.Remove(c)
-		}
 		p.lock.Unlock()
 		// fetch entire graph
 		err := mdag.FetchGraph(ctx, c, p.dserv)
-- 
GitLab