Commit 550ed3b3 authored by Steven Allen's avatar Steven Allen

pin: fix pin update X Y where X==Y

We were pining Y then removing the pin for X. When X == Y, we'd remove the new
pin.

fixes #6648
parent 91a73c74
......@@ -516,6 +516,14 @@ func (p *pinner) RecursiveKeys() []cid.Cid {
// this is more efficient than simply pinning the new one and unpinning the
// old one
func (p *pinner) Update(ctx context.Context, from, to cid.Cid, unpin bool) error {
if from == to {
// Nothing to do. Don't remove this check or we'll end up
// _removing_ the pin.
//
// See #6648
return nil
}
p.lock.Lock()
defer p.lock.Unlock()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment