Check upper bound for deal duration
This commit is contained in:
parent
6abf7384e2
commit
c2e469095c
@ -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