diff --git a/blake32.cu b/blake32.cu index 96a78a0..6b51e2e 100644 --- a/blake32.cu +++ b/blake32.cu @@ -361,7 +361,7 @@ extern "C" int scanhash_blake256(int thr_id, uint32_t *pdata, const uint32_t *pt be32enc(&endiandata[19], extra_results[0]); blake256hash(vhashcpu, endiandata, blakerounds); if (vhashcpu[7] <= Htarg && fulltest(vhashcpu, ptarget)) { - applog(LOG_NOTICE, "GPU found more than one result yippee!"); + applog(LOG_NOTICE, "GPU found more than one result " CL_GRN "yippee!"); rc = 2; } else { extra_results[0] = MAXU; diff --git a/cpu-miner.c b/cpu-miner.c index 2b04c5c..77a7526 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -181,7 +181,7 @@ bool want_stratum = true; bool have_stratum = false; static bool submit_old = false; bool use_syslog = false; -bool use_colors = false; +bool use_colors = true; static bool opt_background = false; bool opt_quiet = false; static int opt_retries = -1; @@ -940,12 +940,11 @@ static void *miner_thread(void *userdata) } if (memcmp(work.data, g_work.data, wcmplen)) { if (opt_debug) { - applog(LOG_DEBUG, "job %s work updated", g_work.job_id); - for (int n=0; n range.scanned[0] && start_nonce < range.scanned[1]); if (stall) { - if (opt_algo) + if (opt_debug && !opt_quiet) applog(LOG_DEBUG, "job done, wait for a new one..."); work_restart[thr_id].restart = 1; hashlog_purge_old(); @@ -1464,13 +1463,14 @@ static void parse_arg (int key, char *arg) case 'C': use_colors = true; break; - case 'q': - opt_quiet = true; - break; case 'D': opt_debug = true; opt_debug_rpc = true; break; + case 'q': + opt_quiet = true; + opt_debug_rpc = false; + break; case 'p': free(rpc_pass); rpc_pass = strdup(arg); diff --git a/miner.h b/miner.h index e33bfff..6bd0ae5 100644 --- a/miner.h +++ b/miner.h @@ -422,6 +422,7 @@ size_t time2str(char* buf, time_t timer); char* atime2str(time_t timer); void applog_hash(unsigned char *hash); +void applog_compare_hash(unsigned char *hash, unsigned char *hash2); void print_hash_tests(void); void animehash(void *state, const void *input); diff --git a/util.c b/util.c index 6ed44c0..eb4af11 100644 --- a/util.c +++ b/util.c @@ -1401,6 +1401,20 @@ static char* format_hash(char* buf, unsigned char *hash) return buf; } +/* to debug diff in data */ +extern void applog_compare_hash(unsigned char *hash, unsigned char *hash2) +{ + char s[256] = ""; + int len = 0; + for (int i=0; i < 32; i += 4) { + char *color = memcmp(hash+i, hash2+i, 4) ? CL_RED : CL_GRY; + len += sprintf(s+len, "%s%02x%02x%02x%02x " CL_GRY, color, + hash[i], hash[i+1], hash[i+2], hash[i+3]); + s[len] = '\0'; + } + applog(LOG_DEBUG, "%s", s); +} + extern void applog_hash(unsigned char *hash) { char s[128] = {'\0'};