default:
work_set_target(work, sctx->job.diff / opt_diff_factor);
}
+
+ if (stratum_diff != sctx->job.diff) {
+ char sdiff[32] = { 0 };
+ // store for api stats
+ stratum_diff = sctx->job.diff;
+ if (opt_showdiff && work->targetdiff != stratum_diff)
+ snprintf(sdiff, 32, " (%.5f)", work->targetdiff);
+ applog(LOG_WARNING, "Stratum difficulty set to %g%s", stratum_diff, sdiff);
+ }
}
}
void parse_config(json_t *config, char *ref);
void proper_exit(int reason);
+void applog_data(void *pdata);
void applog_hash(void *hash);
void format_hashrate(double hashrate, char *output);
void print_hash_tests(void);
sctx->next_diff = diff;
pthread_mutex_unlock(&sctx->work_lock);
- /* store for api stats */
- stratum_diff = diff;
-
- applog(LOG_WARNING, "Stratum difficulty set to %g", diff);
-
return true;
}
applog(LOG_DEBUG, "%s", format_hash(s, (uchar*) hash));
}
+void applog_data(void *pdata)
+{
+ char* hex = abin2hex((uchar*)pdata, 80);
+ applog(LOG_DEBUG, "%s", hex);
+ free(hex);
+}
+
#define printpfx(n,h) \
printf("%s%11s%s: %s\n", CL_CYN, n, CL_N, format_hash(s, (uint8_t*) h))