mirror of
https://github.com/GOSTSec/ccminer
synced 2025-02-02 09:54:26 +00:00
clean extra logs, show bloc height on new jobs
This commit is contained in:
parent
415945eb20
commit
2ebfb546a6
@ -5,5 +5,5 @@
|
|||||||
|
|
||||||
#--ptxas-options=\"-v -dlcm=cg\""
|
#--ptxas-options=\"-v -dlcm=cg\""
|
||||||
|
|
||||||
CUDA_CFLAGS="-O3" ./configure "CFLAGS=-O3" "CXXFLAGS=-O3" --with-cuda=/usr/local/cuda
|
CUDA_CFLAGS="-O2" ./configure "CFLAGS=-O2" "CXXFLAGS=-O2" --with-cuda=/usr/local/cuda
|
||||||
|
|
||||||
|
17
cpu-miner.c
17
cpu-miner.c
@ -918,9 +918,9 @@ static void *miner_thread(void *userdata)
|
|||||||
g_work_time = time(NULL);
|
g_work_time = time(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (memcmp(work.data, g_work.data, 72)) { // wcmplen)) {
|
if (memcmp(work.data, g_work.data, wcmplen)) {
|
||||||
if (opt_debug) {
|
if (opt_debug) {
|
||||||
applog(LOG_DEBUG, "job %s %08x work updated", g_work.job_id, (*nonceptr));
|
applog(LOG_DEBUG, "job %s work updated", g_work.job_id);
|
||||||
for (int n=0; n<wcmplen; n+=8) {
|
for (int n=0; n<wcmplen; n+=8) {
|
||||||
if (memcmp(work.data + n, g_work.data + n, 8)) {
|
if (memcmp(work.data + n, g_work.data + n, 8)) {
|
||||||
applog(LOG_DEBUG, "diff detected at offset %d", n);
|
applog(LOG_DEBUG, "diff detected at offset %d", n);
|
||||||
@ -933,7 +933,7 @@ static void *miner_thread(void *userdata)
|
|||||||
(*nonceptr) = (0xffffffffUL / opt_n_threads) * thr_id; // 0 if single thr
|
(*nonceptr) = (0xffffffffUL / opt_n_threads) * thr_id; // 0 if single thr
|
||||||
} else if (memcmp(work.target, g_work.target, sizeof(work.target))) {
|
} else if (memcmp(work.target, g_work.target, sizeof(work.target))) {
|
||||||
if (opt_debug) {
|
if (opt_debug) {
|
||||||
applog(LOG_DEBUG, "job %s %08x target change", g_work.job_id, (*nonceptr));
|
applog(LOG_DEBUG, "job %s target change", g_work.job_id);
|
||||||
applog_hash((uint8_t*) work.target);
|
applog_hash((uint8_t*) work.target);
|
||||||
applog_hash((uint8_t*) g_work.target);
|
applog_hash((uint8_t*) g_work.target);
|
||||||
}
|
}
|
||||||
@ -944,7 +944,8 @@ static void *miner_thread(void *userdata)
|
|||||||
pthread_mutex_unlock(&g_work_lock);
|
pthread_mutex_unlock(&g_work_lock);
|
||||||
work_restart[thr_id].restart = 0;
|
work_restart[thr_id].restart = 0;
|
||||||
|
|
||||||
applog(LOG_WARNING, "job %s %08x", g_work.job_id, (*nonceptr));
|
if (opt_debug)
|
||||||
|
applog(LOG_WARNING, "job %s %08x", g_work.job_id, (*nonceptr));
|
||||||
|
|
||||||
/* adjust max_nonce to meet target scan time */
|
/* adjust max_nonce to meet target scan time */
|
||||||
if (have_stratum)
|
if (have_stratum)
|
||||||
@ -1328,16 +1329,20 @@ static void *stratum_thread(void *userdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (stratum.job.job_id &&
|
if (stratum.job.job_id &&
|
||||||
(strcmp(stratum.job.job_id, g_work.job_id) || !g_work_time)) {
|
(!g_work_time || strncmp(stratum.job.job_id, g_work.job_id + 8, 120))) {
|
||||||
pthread_mutex_lock(&g_work_lock);
|
pthread_mutex_lock(&g_work_lock);
|
||||||
stratum_gen_work(&stratum, &g_work);
|
stratum_gen_work(&stratum, &g_work);
|
||||||
time(&g_work_time);
|
time(&g_work_time);
|
||||||
pthread_mutex_unlock(&g_work_lock);
|
pthread_mutex_unlock(&g_work_lock);
|
||||||
if (stratum.job.clean) {
|
if (stratum.job.clean) {
|
||||||
if (!opt_quiet)
|
if (!opt_quiet)
|
||||||
applog(LOG_BLUE, "%s send a new %s job", short_url, algo_names[opt_algo]);
|
applog(LOG_BLUE, "%s requested %s job %d restart, block %d", short_url, algo_names[opt_algo],
|
||||||
|
strtoul(stratum.job.job_id, NULL, 16), stratum.bloc_height);
|
||||||
restart_threads();
|
restart_threads();
|
||||||
hashlog_purge_old();
|
hashlog_purge_old();
|
||||||
|
} else if (!opt_quiet) {
|
||||||
|
applog(LOG_BLUE, "%s send %s job %d, block %d", short_url, algo_names[opt_algo],
|
||||||
|
strtoul(stratum.job.job_id, NULL, 16), stratum.bloc_height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,8 +101,8 @@ extern "C" void hashlog_remember_scan_range(char* jobid, uint32_t scanned_from,
|
|||||||
data.tm_upd = (uint32_t) time(NULL);
|
data.tm_upd = (uint32_t) time(NULL);
|
||||||
|
|
||||||
tlastshares[keyall] = data;
|
tlastshares[keyall] = data;
|
||||||
applog(LOG_BLUE, "job %s range : %x %x -> %x %x", jobid,
|
/* applog(LOG_BLUE, "job %s range : %x %x -> %x %x", jobid,
|
||||||
scanned_from, scanned_to, data.scanned_from, data.scanned_to);/* */
|
scanned_from, scanned_to, data.scanned_from, data.scanned_to); */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
1
miner.h
1
miner.h
@ -380,6 +380,7 @@ struct stratum_ctx {
|
|||||||
pthread_mutex_t work_lock;
|
pthread_mutex_t work_lock;
|
||||||
|
|
||||||
int srvtime_diff;
|
int srvtime_diff;
|
||||||
|
int bloc_height;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool stratum_socket_full(struct stratum_ctx *sctx, int timeout);
|
bool stratum_socket_full(struct stratum_ctx *sctx, int timeout);
|
||||||
|
3
util.c
3
util.c
@ -1069,10 +1069,13 @@ static bool stratum_notify(struct stratum_ctx *sctx, json_t *params)
|
|||||||
coinb2_size = strlen(coinb2) / 2;
|
coinb2_size = strlen(coinb2) / 2;
|
||||||
sctx->job.coinbase_size = coinb1_size + sctx->xnonce1_size +
|
sctx->job.coinbase_size = coinb1_size + sctx->xnonce1_size +
|
||||||
sctx->xnonce2_size + coinb2_size;
|
sctx->xnonce2_size + coinb2_size;
|
||||||
|
|
||||||
sctx->job.coinbase = (unsigned char*)realloc(sctx->job.coinbase, sctx->job.coinbase_size);
|
sctx->job.coinbase = (unsigned char*)realloc(sctx->job.coinbase, sctx->job.coinbase_size);
|
||||||
sctx->job.xnonce2 = sctx->job.coinbase + coinb1_size + sctx->xnonce1_size;
|
sctx->job.xnonce2 = sctx->job.coinbase + coinb1_size + sctx->xnonce1_size;
|
||||||
hex2bin(sctx->job.coinbase, coinb1, coinb1_size);
|
hex2bin(sctx->job.coinbase, coinb1, coinb1_size);
|
||||||
memcpy(sctx->job.coinbase + coinb1_size, sctx->xnonce1, sctx->xnonce1_size);
|
memcpy(sctx->job.coinbase + coinb1_size, sctx->xnonce1, sctx->xnonce1_size);
|
||||||
|
|
||||||
|
sctx->bloc_height = le16dec((uint8_t*) sctx->job.coinbase + 43);
|
||||||
if (!sctx->job.job_id || strcmp(sctx->job.job_id, job_id))
|
if (!sctx->job.job_id || strcmp(sctx->job.job_id, job_id))
|
||||||
memset(sctx->job.xnonce2, 0, sctx->xnonce2_size);
|
memset(sctx->job.xnonce2, 0, sctx->xnonce2_size);
|
||||||
hex2bin(sctx->job.xnonce2 + sctx->xnonce2_size, coinb2, coinb2_size);
|
hex2bin(sctx->job.xnonce2 + sctx->xnonce2_size, coinb2, coinb2_size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user