diff --git a/extern/storage-sealing/checks.go b/extern/storage-sealing/checks.go index 56b0677c4..dc045ded2 100644 --- a/extern/storage-sealing/checks.go +++ b/extern/storage-sealing/checks.go @@ -214,8 +214,13 @@ func checkReplicaUpdate(ctx context.Context, maddr address.Address, si SectorInf if err != nil { return &ErrApi{xerrors.Errorf("calling StateComputeDataCommitment: %w", err)} } - if si.UpdateUnsealed == nil || !commD.Equals(*si.UpdateUnsealed) { - return &ErrBadRU{xerrors.Errorf("on chain CommD differs from sector: %s != %s", commD, si.CommD)} + + if si.UpdateUnsealed == nil { + return &ErrBadRU{xerrors.New("nil UpdateUnsealed cid after replica update")} + } + + if !commD.Equals(*si.UpdateUnsealed) { + return &ErrBadRU{xerrors.Errorf("calculated CommD differs from updated replica: %s != %s", commD, *si.UpdateUnsealed)} } if si.UpdateSealed == nil {