Merge pull request #9753 from filecoin-project/gstuart/fix-devnet-deals
fix: cli: Check upper bound for deal duration
This commit is contained in:
commit
33a176eae4
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user