This repository was archived by the owner on Jun 6, 2023. It is now read-only.

Description
|
func dealGetPaymentRemaining(deal *DealProposal, slashEpoch abi.ChainEpoch) abi.TokenAmount { |
|
Assert(slashEpoch <= deal.EndEpoch) |
|
|
|
// Payments are always for start -> end epoch irrespective of when the deal is slashed. |
|
if slashEpoch < deal.StartEpoch { |
|
slashEpoch = deal.StartEpoch |
|
} |
|
|
|
durationRemaining := deal.EndEpoch - slashEpoch |
|
Assert(durationRemaining > 0) |
Assert(durationRemaining > 0) does not account for the case where slashEpoch == deal.EndEpoch.
(This shouldn't happen as OnMinerSectorsTerminate will not allow a slash epoch to be set for expired deals.)