Check upper bound for deal duration

This commit is contained in:
Geoff Stuart 2022-11-29 14:51:52 -05:00
parent 6abf7384e2
commit c2e469095c

View File

@ -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
}