mirror of
https://github.com/GOSTSec/sgminer
synced 2025-08-26 13:52:02 +00:00
Add a solution counter to the output.
This commit is contained in:
parent
7062557e74
commit
ce750e42b3
12
cpu-miner.c
12
cpu-miner.c
@ -131,6 +131,7 @@ pthread_mutex_t time_lock;
|
|||||||
static pthread_mutex_t hash_lock;
|
static pthread_mutex_t hash_lock;
|
||||||
static unsigned long total_hashes_done;
|
static unsigned long total_hashes_done;
|
||||||
static struct timeval total_tv_start;
|
static struct timeval total_tv_start;
|
||||||
|
static int solutions;
|
||||||
|
|
||||||
|
|
||||||
struct option_help {
|
struct option_help {
|
||||||
@ -412,6 +413,7 @@ static bool workio_submit_work(struct workio_cmd *wc, CURL *curl)
|
|||||||
{
|
{
|
||||||
int failures = 0;
|
int failures = 0;
|
||||||
|
|
||||||
|
solutions++;
|
||||||
/* submit solution to bitcoin via JSON-RPC */
|
/* submit solution to bitcoin via JSON-RPC */
|
||||||
while (!submit_upstream_work(curl, wc->u.work)) {
|
while (!submit_upstream_work(curl, wc->u.work)) {
|
||||||
if (unlikely((opt_retries >= 0) && (++failures > opt_retries))) {
|
if (unlikely((opt_retries >= 0) && (++failures > opt_retries))) {
|
||||||
@ -497,11 +499,13 @@ static void hashmeter(int thr_id, struct timeval *diff,
|
|||||||
pthread_mutex_unlock(&hash_lock);
|
pthread_mutex_unlock(&hash_lock);
|
||||||
total_secs = (double)total_diff.tv_sec +
|
total_secs = (double)total_diff.tv_sec +
|
||||||
((double)total_diff.tv_usec / 1000000.0);
|
((double)total_diff.tv_usec / 1000000.0);
|
||||||
applog(LOG_INFO, "[Total: %.2f Mhash/sec] [thread %d: %lu hashes, %.0f khash/sec]",
|
applog(LOG_INFO, "[Total: %.2f Mhash/sec] "
|
||||||
total_mhashes / total_secs, thr_id, hashes_done, khashes / secs);
|
"[thread %d: %lu hashes, %.0f khash/sec] [Solved: %d]",
|
||||||
|
total_mhashes / total_secs, thr_id, hashes_done,
|
||||||
|
khashes / secs, solutions);
|
||||||
} else {
|
} else {
|
||||||
applog(LOG_INFO, "[%lu hashes, %.0f khash/sec]",
|
applog(LOG_INFO, "[%lu hashes, %.0f khash/sec] [Solved: %d]",
|
||||||
hashes_done, khashes / secs);
|
hashes_done, khashes / secs, solutions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user