Skip to content

Commit

Permalink
Check upper bound for deal duration
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff-vball committed Nov 29, 2022
1 parent 6abf738 commit b9bb035
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,12 @@ uiLoop:
continue
}

maxDealDurationDays := uint64(build.MaxDealDuration) / (builtin.SecondsInDay / build.BlockDelaySecs)
if days < int(maxDealDurationDays) {
printErr(xerrors.Errorf("maximum duration is %d days", maxDealDurationDays))
continue
}

dur = 24 * time.Hour * time.Duration(days)
epochs = abi.ChainEpoch(dur / (time.Duration(build.BlockDelaySecs) * time.Second))

Expand Down

0 comments on commit b9bb035

Please sign in to comment.