Skip to content

Commit

Permalink
Tweak client calcDealExpiration to consider genesis miners
Browse files Browse the repository at this point in the history
  • Loading branch information
arajasek committed May 27, 2021
1 parent 1ad2c4d commit d9e86af
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion node/impl/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ func calcDealExpiration(minDuration uint64, md *dline.Info, startEpoch abi.Chain
minExp := startEpoch + abi.ChainEpoch(minDuration)

// Align on miners ProvingPeriodBoundary
return minExp + md.WPoStProvingPeriod - (minExp % md.WPoStProvingPeriod) + (md.PeriodStart % md.WPoStProvingPeriod) - 1
exp := minExp + md.WPoStProvingPeriod - (minExp % md.WPoStProvingPeriod) + (md.PeriodStart % md.WPoStProvingPeriod) - 1
// Should only be possible for miners created around genesis
for exp < minExp {
exp += md.WPoStProvingPeriod
}

return exp
}

func (a *API) imgr() *importmgr.Mgr {
Expand Down

0 comments on commit d9e86af

Please sign in to comment.