fix defered unlock of pin lock in AddR

This wasn't causing any problems because this function is actually dead
code (but possibly useful?).

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
Steven Allen 2018-01-07 22:33:51 -08:00
parent c1a488f55c
commit bf5fd74a8e

View File

@ -322,7 +322,7 @@ func AddWithContext(ctx context.Context, n *core.IpfsNode, r io.Reader) (string,
// AddR recursively adds files in |path|.
func AddR(n *core.IpfsNode, root string) (key string, err error) {
n.Blockstore.PinLock().Unlock()
defer n.Blockstore.PinLock().Unlock()
stat, err := os.Lstat(root)
if err != nil {