Skip to content

Commit

Permalink
more min/max exponent None checking
Browse files Browse the repository at this point in the history
  • Loading branch information
brubsby committed Sep 9, 2024
1 parent b1b9193 commit 9995ac1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions primenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -5227,7 +5227,7 @@ def get_assignments(adapter, adir, cpu_num, progress, tasks):
if config.has_option(SEC.PrimeNet, "MaxExponents"):
amax = config.getint(SEC.PrimeNet, "MaxExponents")
elif options.mfaktc or options.mfakto:
if options.min_exp >= 1000000000:
if options.min_exp and options.min_exp >= 1000000000:
amax = 10000 # tf1G
else:
amax = 1000 # primenet TF
Expand Down Expand Up @@ -5276,7 +5276,7 @@ def get_assignments(adapter, adir, cpu_num, progress, tasks):
)
)

if options.min_exp >= 1000000000 and work_preference[cpu_num] in [2, 12]:
if options.min_exp and options.min_exp >= 1000000000 and work_preference[cpu_num] in [2, 12]:
if msec_per_iter is not None:
ghd_to_request = int(max(10,(days_work.total_seconds() - cur_time_left)) * 1000 / msec_per_iter)
assignments = tf1g_fetch(adapter, adir, cpu_num, options.bit_min, options.bit_max, num_to_get, ghd_to_request)
Expand Down Expand Up @@ -6681,7 +6681,7 @@ def is_pyinstaller():
config.set(SEC.PrimeNet, "DaysOfWork", str(options.days_of_work))
if not config.has_option(SEC.PrimeNet, "MaxExponents"):
if options.mfaktc or options.mfakto:
if options.min_exp >= 1000000000:
if options.min_exp and options.min_exp >= 1000000000:
amax = 10000 # tf1G
else:
amax = 1000 # primenet TF
Expand Down Expand Up @@ -6813,7 +6813,7 @@ def is_pyinstaller():
)
)

if options.min_exp < 1000000000 < options.max_exp:
if options.min_exp and options.max_exp and options.min_exp < 1000000000 < options.max_exp:
parser.error("Min exponent ({0}) and max exponent ({1}) must both be less than or greater than 1,000,000,000 (for tf1G)".format(options.min_exp, options.max_exp))

if not 0 <= options.days_of_work <= 180:
Expand Down

0 comments on commit 9995ac1

Please sign in to comment.