fix bug in hour range validity checking

This commit is contained in:
cryptonote-social 2020-09-04 14:28:18 -07:00
parent d34e2d3d31
commit 45c0afad34
2 changed files with 2 additions and 2 deletions

View File

@ -84,7 +84,7 @@ func MultiMain(s MachineStater, agent string) {
crylog.Fatal(INVALID_EXCLUDE_FORMAT_MESSAGE, err) crylog.Fatal(INVALID_EXCLUDE_FORMAT_MESSAGE, err)
return return
} }
if hr1 > 24 || hr1 < 0 || hr2 > 24 || hr1 < 0 { if hr1 > 24 || hr1 < 0 || hr2 > 24 || hr2 < 0 {
crylog.Fatal("INVALID_EXCLUDE_FORMAT_MESSAGE", ": XX and YY must each be between 0 and 24") crylog.Fatal("INVALID_EXCLUDE_FORMAT_MESSAGE", ": XX and YY must each be between 0 and 24")
return return
} }

View File

@ -267,7 +267,7 @@ func InitMiner(args *InitMinerArgs) *InitMinerResponse {
r := &InitMinerResponse{} r := &InitMinerResponse{}
hr1 := args.ExcludeHourStart hr1 := args.ExcludeHourStart
hr2 := args.ExcludeHourEnd hr2 := args.ExcludeHourEnd
if hr1 > 24 || hr1 < 0 || hr2 > 24 || hr1 < 0 { if hr1 > 24 || hr1 < 0 || hr2 > 24 || hr2 < 0 {
r.Code = 3 r.Code = 3
r.Message = "exclude_hour_start and exclude_hour_end must each be between 0 and 24" r.Message = "exclude_hour_start and exclude_hour_end must each be between 0 and 24"
return r return r