diff --git a/ipfsconn/ipfshttp/ipfshttp.go b/ipfsconn/ipfshttp/ipfshttp.go index 374098a4..c8445929 100644 --- a/ipfsconn/ipfshttp/ipfshttp.go +++ b/ipfsconn/ipfshttp/ipfshttp.go @@ -656,10 +656,9 @@ func (ipfs *Connector) PinLsCid(ctx context.Context, hash *cid.Cid) (api.IPFSPin return api.IPFSPinStatusError, err } - // Pin not found. Try next type - if err != nil { - continue - + // Pin found. Do not keep looking. + if err == nil { + break } } diff --git a/state/mapstate/migrate.go b/state/mapstate/migrate.go index cce57d84..7970e981 100644 --- a/state/mapstate/migrate.go +++ b/state/mapstate/migrate.go @@ -151,11 +151,12 @@ func (st *mapStateV4) next() migrateable { pinsv5.Cid = v.Cid pinsv5.Type = uint64(api.DataType) pinsv5.Allocations = v.Allocations - if v.Recursive { - pinsv5.MaxDepth = -1 - } else { - pinsv5.MaxDepth = 0 - } + + // Encountered pins with Recursive=false + // in previous states. Since we do not support + // non recursive pins yet, we fix it by + // harcoding MaxDepth. + pinsv5.MaxDepth = -1 // Options pinsv5.Name = v.Name