diff --git a/src/gmc_con.erl b/src/gmc_con.erl index 48b04ed..a2e36e5 100644 --- a/src/gmc_con.erl +++ b/src/gmc_con.erl @@ -101,16 +101,28 @@ start_link() -> init(none) -> ok = log(info, "Starting"), + {AProcs, AMem} = proc_mem(), + TwoMaps = default_spec(mem) * 2, + RProcs = + case AProcs >= 2 of + true -> 2; + false -> 1 + end, + RMem = + case AMem >= TwoMaps of + true -> TwoMaps; + false -> default_spec(mem) + end, {Acc, Keys, Network, MaxCores, MaxMem} = case read_conf() of {ok, C} -> {maps:get(account, C, none), maps:get(keys, C, []), maps:get(network, C, <<"mainnet">>), - maps:get(max_cores, C, 2), - maps:get(max_mem, C, 3550722201)}; + maps:get(max_cores, C, RProcs), + maps:get(max_mem, C, RMem)}; none -> - {none, [], <<"mainnet">>, 2, 3550722201} + {none, [], <<"mainnet">>, RProcs, RMem} end, State = #s{network = Network, acc = Acc, keys = Keys, max_cores = MaxCores, max_mem = MaxMem}, {ok, start_gui(State)}. @@ -252,7 +264,7 @@ optimize_count(MaxC, MaxM) -> MaxMem = max(MapSize, MaxM), {Procs, Memory} = proc_mem(), MeanMaps = min(MaxMem, Memory) div MapSize, - Recommended = min(MaxCores, max(min(Procs, MeanMaps) - 1, 1)), + Recommended = min(MaxCores, min(Procs, MeanMaps)), Notice = fun(F, A) -> gmc_gui:message({notice, io_lib:format(F, A)}) end, ok = Notice("Physical Processors: ~p", [Procs]), ok = Notice("Physical Memory: ~p", [Memory]), diff --git a/src/gmc_gui.erl b/src/gmc_gui.erl index b819fec..99760db 100644 --- a/src/gmc_gui.erl +++ b/src/gmc_gui.erl @@ -277,7 +277,7 @@ do_message({pool_notification, #{info := #{msg := MSG}}}, State = #s{height = He ok = wxStaticText:setLabel(CandT, Candidate), State; #{solution_accepted := #{seq := Seq}} -> - Entry = io_lib:format("~nSolution Accepted! You solved one! Sequence: ~w", [Seq]), + Entry = io_lib:format("~nThe hive has produced a solution! Sequence: ~w", [Seq]), do_message2(Entry, State); Other -> Entry = io_lib:format("~nUnexpected 'pool_notification': ~tp", [Other]), diff --git a/zomp.meta b/zomp.meta index cadf99b..7e1deac 100644 --- a/zomp.meta +++ b/zomp.meta @@ -5,10 +5,10 @@ {desc,"Mining client for the Gajumaru Root"}. {author,"Craig Everett"}. {package_id,{"qpq","gajumine",{0,2,6}}}. -{deps,[{"uwiger","gmhive_client",{0,4,4}}, +{deps,[{"uwiger","gmhive_worker",{0,4,0}}, + {"qpq","cuckoo_cpu",{0,3,1}}, + {"uwiger","gmhive_client",{0,4,4}}, {"uwiger","gmcuckoo",{1,2,3}}, - {"qpq","cuckoo_cpu",{0,3,0}}, - {"uwiger","gmhive_worker",{0,3,0}}, {"uwiger","gmconfig",{0,1,2}}, {"uwiger","gproc",{1,0,1}}, {"uwiger","gmhive_protocol",{0,1,1}},