make state diffing work with partial state trees
This commit is contained in:
parent
89b88c1e0d
commit
16243b97aa
@ -233,7 +233,12 @@ func writeStateToTempCAR(bs blockstore.Blockstore, roots ...cid.Cid) (string, er
|
||||
if link.Cid.Prefix().Codec == cid.FilCommitmentSealed || link.Cid.Prefix().Codec == cid.FilCommitmentUnsealed {
|
||||
continue
|
||||
}
|
||||
out = append(out, link)
|
||||
// ignore things we don't have, the state tree is incomplete.
|
||||
if has, err := bs.Has(link.Cid); err != nil {
|
||||
return nil, err
|
||||
} else if has {
|
||||
out = append(out, link)
|
||||
}
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user