Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

Commit 278e425

Browse files
committedSep 28, 2018
Correct handling of --display-interval.
To use less cpu ethminer slept always for two seconds till display-interval was reached or exceeded. This commit corrects the handling of display interval. Cherry-pick of 75f43e8
1 parent 8d9674b commit 278e425

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed
 

‎ethminer/main.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -897,12 +897,15 @@ class MinerCLI
897897
// Wait at the beginning of the loop to give some time
898898
// services to start properly. Otherwise we get a "not-connected"
899899
// message immediately
900-
this_thread::sleep_for(chrono::seconds(2));
901-
if (interval > 2)
902-
{
903-
interval -= 2;
900+
901+
// Split m_displayInterval in 1 second parts to optain a faster exit
902+
this_thread::sleep_for(chrono::seconds(1));
903+
interval--;
904+
if (interval)
904905
continue;
905-
}
906+
interval = m_displayInterval;
907+
908+
// Display current stats of the farm if it's connected
906909
if (mgr.isConnected())
907910
{
908911
auto mp = f.miningProgress();
@@ -916,7 +919,6 @@ class MinerCLI
916919
{
917920
minelog << "not-connected";
918921
}
919-
interval = m_displayInterval;
920922
}
921923

922924
#if API_CORE

0 commit comments

Comments
 (0)
This repository has been archived.