@cryptotaxi247 / kubo / commits / 7ed1a5361

Repeat recurse/direct pin checks since they could have changed

License: MIT Signed-off-by: Michael Avila <me@michaelavila.com>

Michael Avila committed Sep 23, 2018 at 09:29 UTC 7ed1a5361f7516d223dda15ce5539c5afbb23d2d
1 file changed +8
pin/pin.go
+8
@@ -236,6 +236,14 @@ func (p *pinner) Pin(ctx context.Context, node ipld.Node, recurse bool) error {
236 return err
237 }
238
239 + if p.recursePin.Has(c) {
240 + return nil
241 + }
242 +
243 + if p.directPin.Has(c) {
244 + p.directPin.Remove(c)
245 + }
246 +
247 p.recursePin.Add(c)
248 } else {
249 p.lock.Unlock()