diff --git a/core/commands/files/files.go b/core/commands/files/files.go index 1bec952dd2e7..bf5a3bcdf0da 100644 --- a/core/commands/files/files.go +++ b/core/commands/files/files.go @@ -640,9 +640,6 @@ are run with the '--flush=false'. return } - // take the lock and defer the unlock - defer nd.Blockstore.PinLock().Unlock() - path := "/" if len(req.Arguments()) > 0 { path = req.Arguments()[0] diff --git a/core/core.go b/core/core.go index 9ee7b44d2998..fa01d4a6901b 100644 --- a/core/core.go +++ b/core/core.go @@ -474,30 +474,6 @@ func (n *IpfsNode) loadBootstrapPeers() ([]peer.PeerInfo, error) { func (n *IpfsNode) loadFilesRoot() error { dsk := ds.NewKey("/local/filesroot") pf := func(ctx context.Context, k key.Key) error { - defer n.Blockstore.PinLock().Unlock() - ds := n.Repo.Datastore() - if old, err := ds.Get(dsk); err == nil && old != nil { - err := n.Pinning.Unpin(ctx, key.Key(old.([]byte)), true) - switch err { - case nil, pin.ErrNotPinned: - break - default: - return err - } - } - nnd, err := n.DAG.Get(ctx, k) - if err != nil { - return err - } - - if err := n.Pinning.Pin(ctx, nnd, true); err != nil { - return err - } - - if err := n.Pinning.Flush(); err != nil { - return err - } - return n.Repo.Datastore().Put(dsk, []byte(k)) }