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 c2e4690
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,13 @@ uiLoop:

minDealDurationDays := uint64(build.MinDealDuration) / (builtin.SecondsInDay / build.BlockDelaySecs)
if days < int(minDealDurationDays) {
printErr(xerrors.Errorf("minimum duration is %d days", minDealDurationDays))
printErr(xerrors.Errorf("minimum duration is %d days, got %d", minDealDurationDays, days))
continue
}

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

Expand Down

0 comments on commit c2e4690

Please sign in to comment.