mirror of
https://github.com/JayDDee/cpuminer-opt.git
synced 2025-09-17 23:44:27 +00:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0e1e88f53e | ||
![]() |
45c77a5c81 |
@@ -65,6 +65,18 @@ If not what makes it happen or not happen?
|
||||
Change Log
|
||||
----------
|
||||
|
||||
v3.12.4.3
|
||||
|
||||
Fixed segfault in new block log for getwork.
|
||||
|
||||
Disabled silent discarding of stale work after the submit is logged.
|
||||
|
||||
v3.12.4.2
|
||||
|
||||
Issue #245: fixed getwork stale shares, solo mining with getwork now works.
|
||||
|
||||
Issue #246: implemented block and summary logs for getwork.
|
||||
|
||||
v3.12.4.1
|
||||
|
||||
Issue #245: fix scantime when mining solo with getwork.
|
||||
|
20
configure
vendored
20
configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for cpuminer-opt 3.12.4.1.
|
||||
# Generated by GNU Autoconf 2.69 for cpuminer-opt 3.12.4.3.
|
||||
#
|
||||
#
|
||||
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
||||
@@ -577,8 +577,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='cpuminer-opt'
|
||||
PACKAGE_TARNAME='cpuminer-opt'
|
||||
PACKAGE_VERSION='3.12.4.1'
|
||||
PACKAGE_STRING='cpuminer-opt 3.12.4.1'
|
||||
PACKAGE_VERSION='3.12.4.3'
|
||||
PACKAGE_STRING='cpuminer-opt 3.12.4.3'
|
||||
PACKAGE_BUGREPORT=''
|
||||
PACKAGE_URL=''
|
||||
|
||||
@@ -1332,7 +1332,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures cpuminer-opt 3.12.4.1 to adapt to many kinds of systems.
|
||||
\`configure' configures cpuminer-opt 3.12.4.3 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1404,7 +1404,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of cpuminer-opt 3.12.4.1:";;
|
||||
short | recursive ) echo "Configuration of cpuminer-opt 3.12.4.3:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1509,7 +1509,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
cpuminer-opt configure 3.12.4.1
|
||||
cpuminer-opt configure 3.12.4.3
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@@ -2012,7 +2012,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by cpuminer-opt $as_me 3.12.4.1, which was
|
||||
It was created by cpuminer-opt $as_me 3.12.4.3, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -2993,7 +2993,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='cpuminer-opt'
|
||||
VERSION='3.12.4.1'
|
||||
VERSION='3.12.4.3'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -6690,7 +6690,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by cpuminer-opt $as_me 3.12.4.1, which was
|
||||
This file was extended by cpuminer-opt $as_me 3.12.4.3, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -6756,7 +6756,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
cpuminer-opt config.status 3.12.4.1
|
||||
cpuminer-opt config.status 3.12.4.3
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
AC_INIT([cpuminer-opt], [3.12.4.1])
|
||||
AC_INIT([cpuminer-opt], [3.12.4.3])
|
||||
|
||||
AC_PREREQ([2.59c])
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
279
cpu-miner.c
279
cpu-miner.c
@@ -431,68 +431,71 @@ static bool work_decode( const json_t *val, struct work *work )
|
||||
static const char *info_req =
|
||||
"{\"method\": \"getmininginfo\", \"params\": [], \"id\":8}\r\n";
|
||||
|
||||
static bool get_mininginfo(CURL *curl, struct work *work)
|
||||
static bool get_mininginfo( CURL *curl, struct work *work )
|
||||
{
|
||||
if (have_stratum || !allow_mininginfo)
|
||||
if ( have_stratum || !allow_mininginfo )
|
||||
return false;
|
||||
|
||||
int curl_err = 0;
|
||||
json_t *val = json_rpc_call(curl, rpc_url, rpc_userpass, info_req, &curl_err, 0);
|
||||
json_t *val = json_rpc_call( curl, rpc_url, rpc_userpass, info_req,
|
||||
&curl_err, 0 );
|
||||
|
||||
if (!val && curl_err == -1) {
|
||||
if ( !val && curl_err == -1 )
|
||||
{
|
||||
allow_mininginfo = false;
|
||||
if (opt_debug) {
|
||||
applog(LOG_DEBUG, "getmininginfo not supported");
|
||||
}
|
||||
if ( opt_debug )
|
||||
applog( LOG_DEBUG, "getmininginfo not supported" );
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
json_t *res = json_object_get(val, "result");
|
||||
// "blocks": 491493 (= current work height - 1)
|
||||
// "difficulty": 0.99607860999999998
|
||||
// "networkhashps": 56475980
|
||||
if (res)
|
||||
{
|
||||
json_t *key = json_object_get(res, "difficulty");
|
||||
if (key) {
|
||||
if (json_is_object(key))
|
||||
key = json_object_get(key, "proof-of-work");
|
||||
if (json_is_real(key))
|
||||
net_diff = json_real_value(key);
|
||||
}
|
||||
key = json_object_get(res, "networkhashps");
|
||||
if (key && json_is_integer(key)) {
|
||||
net_hashrate = (double) json_integer_value(key);
|
||||
}
|
||||
key = json_object_get(res, "blocks");
|
||||
if (key && json_is_integer(key)) {
|
||||
net_blocks = json_integer_value(key);
|
||||
}
|
||||
if (!work->height)
|
||||
{
|
||||
// complete missing data from getwork
|
||||
work->height = (uint32_t) net_blocks + 1;
|
||||
if (work->height > g_work.height)
|
||||
{
|
||||
restart_threads();
|
||||
if (!opt_quiet) {
|
||||
char netinfo[64] = { 0 };
|
||||
char srate[32] = { 0 };
|
||||
sprintf(netinfo, "diff %.2f", net_diff);
|
||||
if (net_hashrate) {
|
||||
format_hashrate(net_hashrate, srate);
|
||||
strcat(netinfo, ", net ");
|
||||
strcat(netinfo, srate);
|
||||
}
|
||||
applog(LOG_BLUE, "%s block %d, %s",
|
||||
algo_names[opt_algo], work->height, netinfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
json_t *res = json_object_get( val, "result" );
|
||||
// "blocks": 491493 (= current work height - 1)
|
||||
// "difficulty": 0.99607860999999998
|
||||
// "networkhashps": 56475980
|
||||
if ( res )
|
||||
{
|
||||
json_t *key = json_object_get( res, "difficulty" );
|
||||
if ( key )
|
||||
{
|
||||
if ( json_is_object( key ) )
|
||||
key = json_object_get( key, "proof-of-work" );
|
||||
if ( json_is_real( key ) )
|
||||
net_diff = json_real_value( key );
|
||||
}
|
||||
|
||||
key = json_object_get( res, "networkhashps" );
|
||||
if ( key && json_is_integer( key ) )
|
||||
net_hashrate = (double) json_integer_value( key );
|
||||
|
||||
key = json_object_get( res, "blocks" );
|
||||
if ( key && json_is_integer( key ) )
|
||||
net_blocks = json_integer_value( key );
|
||||
|
||||
if ( !work->height )
|
||||
{
|
||||
// complete missing data from getwork
|
||||
work->height = (uint32_t) net_blocks + 1;
|
||||
if ( work->height > g_work.height )
|
||||
{
|
||||
restart_threads();
|
||||
if ( !opt_quiet )
|
||||
{
|
||||
char netinfo[64] = { 0 };
|
||||
char srate[32] = { 0 };
|
||||
sprintf( netinfo, "diff %.2f", net_diff );
|
||||
if ( net_hashrate )
|
||||
{
|
||||
format_hashrate( net_hashrate, srate );
|
||||
strcat( netinfo, ", net " );
|
||||
strcat( netinfo, srate );
|
||||
}
|
||||
applog( LOG_BLUE, "%s block %d, %s",
|
||||
algo_names[opt_algo], work->height, netinfo );
|
||||
}
|
||||
}
|
||||
} // res
|
||||
}
|
||||
json_decref(val);
|
||||
json_decref( val );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1059,25 +1062,39 @@ static int share_result( int result, struct work *null_work,
|
||||
if ( likely( result ) )
|
||||
{
|
||||
accepted_share_count++;
|
||||
sprintf( sres, "S%d", stale_share_count );
|
||||
sprintf( rres, "R%d", rejected_share_count );
|
||||
if unlikely( ( my_stats.net_diff > 0. )
|
||||
&& ( my_stats.share_diff >= net_diff ) )
|
||||
{
|
||||
solved = true;
|
||||
solved_block_count++;
|
||||
sprintf( bres, "BLOCK SOLVED %d", solved_block_count );
|
||||
sprintf( ares, "A%d", accepted_share_count );
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( bres, "B%d", solved_block_count );
|
||||
sprintf( ares, "Accepted %d", accepted_share_count );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( ares, "A%d", accepted_share_count );
|
||||
sprintf( bres, "B%d", solved_block_count );
|
||||
if ( reason && strstr( reason, "Invalid job id" ) )
|
||||
{
|
||||
stale = true;
|
||||
stale_share_count++;
|
||||
sprintf( sres, "Stale %d", stale_share_count );
|
||||
sprintf( rres, "R%d", rejected_share_count );
|
||||
}
|
||||
else
|
||||
{
|
||||
rejected_share_count++;
|
||||
sprintf( sres, "S%d", stale_share_count );
|
||||
sprintf( rres, "Rejected %d" , rejected_share_count );
|
||||
lowdiff_debug = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1103,6 +1120,7 @@ static int share_result( int result, struct work *null_work,
|
||||
|
||||
pthread_mutex_unlock( &stats_lock );
|
||||
|
||||
/*
|
||||
if ( likely( result ) )
|
||||
{
|
||||
if ( unlikely( solved ) )
|
||||
@@ -1133,6 +1151,7 @@ static int share_result( int result, struct work *null_work,
|
||||
sprintf( rres, "Rejected %d" , rejected_share_count );
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if ( use_colors )
|
||||
{
|
||||
@@ -1152,7 +1171,6 @@ static int share_result( int result, struct work *null_work,
|
||||
my_stats.share_count, acol, ares, scol, sres, rcol, rres, bcol,
|
||||
bres, share_time, latency );
|
||||
|
||||
// purge job id when solo, diff is good
|
||||
if ( !opt_quiet )
|
||||
{
|
||||
if ( have_stratum )
|
||||
@@ -1161,16 +1179,8 @@ static int share_result( int result, struct work *null_work,
|
||||
scol, my_stats.job_id );
|
||||
else
|
||||
applog2( LOG_NOTICE, "Diff %.5g (%.3g%), %sBlock %d" CL_WHT,
|
||||
my_stats.share_diff, share_ratio, bcol, stratum.block_height,
|
||||
scol );
|
||||
}
|
||||
|
||||
/*
|
||||
if ( have_stratum && !opt_quiet )
|
||||
applog2( LOG_NOTICE, "Diff %.5g (%.3g%), %sBlock %d, %sJob %s" CL_WHT,
|
||||
my_stats.share_diff, share_ratio, bcol, stratum.block_height,
|
||||
scol, my_stats.job_id );
|
||||
*/
|
||||
my_stats.share_diff, share_ratio, bcol, stratum.block_height );
|
||||
}
|
||||
|
||||
if ( unlikely( reason && !result ) )
|
||||
{
|
||||
@@ -1203,6 +1213,9 @@ static int share_result( int result, struct work *null_work,
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const char *json_submit_req =
|
||||
"{\"method\": \"mining.submit\", \"params\": [\"%s\", \"%s\", \"%s\", \"%s\", \"%s\"], \"id\":4}";
|
||||
|
||||
void std_le_build_stratum_request( char *req, struct work *work )
|
||||
{
|
||||
unsigned char *xnonce2str;
|
||||
@@ -1213,9 +1226,8 @@ void std_le_build_stratum_request( char *req, struct work *work )
|
||||
bin2hex( ntimestr, (char*)(&ntime), sizeof(uint32_t) );
|
||||
bin2hex( noncestr, (char*)(&nonce), sizeof(uint32_t) );
|
||||
xnonce2str = abin2hex( work->xnonce2, work->xnonce2_len );
|
||||
snprintf( req, JSON_BUF_LEN,
|
||||
"{\"method\": \"mining.submit\", \"params\": [\"%s\", \"%s\", \"%s\", \"%s\", \"%s\"], \"id\":4}",
|
||||
rpc_user, work->job_id, xnonce2str, ntimestr, noncestr );
|
||||
snprintf( req, JSON_BUF_LEN, json_submit_req, rpc_user, work->job_id,
|
||||
xnonce2str, ntimestr, noncestr );
|
||||
free( xnonce2str );
|
||||
}
|
||||
|
||||
@@ -1230,12 +1242,14 @@ void std_be_build_stratum_request( char *req, struct work *work )
|
||||
bin2hex( ntimestr, (char*)(&ntime), sizeof(uint32_t) );
|
||||
bin2hex( noncestr, (char*)(&nonce), sizeof(uint32_t) );
|
||||
xnonce2str = abin2hex( work->xnonce2, work->xnonce2_len );
|
||||
snprintf( req, JSON_BUF_LEN,
|
||||
"{\"method\": \"mining.submit\", \"params\": [\"%s\", \"%s\", \"%s\", \"%s\", \"%s\"], \"id\":4}",
|
||||
rpc_user, work->job_id, xnonce2str, ntimestr, noncestr );
|
||||
snprintf( req, JSON_BUF_LEN, json_submit_req, rpc_user, work->job_id,
|
||||
xnonce2str, ntimestr, noncestr );
|
||||
free( xnonce2str );
|
||||
}
|
||||
|
||||
static const char *json_getwork_req =
|
||||
"{\"method\": \"getwork\", \"params\": [\"%s\"], \"id\":4}\r\n";
|
||||
|
||||
bool std_le_submit_getwork_result( CURL *curl, struct work *work )
|
||||
{
|
||||
char req[JSON_BUF_LEN];
|
||||
@@ -1252,8 +1266,7 @@ bool std_le_submit_getwork_result( CURL *curl, struct work *work )
|
||||
return false;
|
||||
}
|
||||
// build JSON-RPC request
|
||||
snprintf( req, JSON_BUF_LEN,
|
||||
"{\"method\": \"getwork\", \"params\": [\"%s\"], \"id\":4}\r\n", gw_str );
|
||||
snprintf( req, JSON_BUF_LEN, json_getwork_req, gw_str );
|
||||
free( gw_str );
|
||||
// issue JSON-RPC request
|
||||
val = json_rpc_call( curl, rpc_url, rpc_userpass, req, NULL, 0 );
|
||||
@@ -1286,8 +1299,7 @@ bool std_be_submit_getwork_result( CURL *curl, struct work *work )
|
||||
return false;
|
||||
}
|
||||
// build JSON-RPC request
|
||||
snprintf( req, JSON_BUF_LEN,
|
||||
"{\"method\": \"getwork\", \"params\": [\"%s\"], \"id\":4}\r\n", gw_str );
|
||||
snprintf( req, JSON_BUF_LEN, json_getwork_req, gw_str );
|
||||
free( gw_str );
|
||||
// issue JSON-RPC request
|
||||
val = json_rpc_call( curl, rpc_url, rpc_userpass, req, NULL, 0 );
|
||||
@@ -1342,25 +1354,27 @@ char* std_malloc_txs_request( struct work *work )
|
||||
|
||||
static bool submit_upstream_work( CURL *curl, struct work *work )
|
||||
{
|
||||
|
||||
/* pass if the previous hash is not the current previous hash */
|
||||
/* Submit anyway, discardring here messes up the stats
|
||||
if ( !submit_old && memcmp( &work->data[1], &g_work.data[1], 32 ) )
|
||||
{
|
||||
if (opt_debug)
|
||||
applog(LOG_DEBUG, "DEBUG: stale work detected, discarding");
|
||||
applog( LOG_WARNING, "Stale work detected, discarding" );
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( !have_stratum && allow_mininginfo )
|
||||
{
|
||||
struct work wheight;
|
||||
get_mininginfo( curl, &wheight );
|
||||
if ( work->height && work->height <= net_blocks )
|
||||
struct work mining_info;
|
||||
get_mininginfo( curl, &mining_info );
|
||||
if ( work->height < mining_info.height )
|
||||
{
|
||||
if (opt_debug)
|
||||
applog(LOG_WARNING, "block %u was already solved", work->height);
|
||||
applog( LOG_WARNING, "Block %u was already solved, current block %d",
|
||||
work->height, mining_info.height );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if ( have_stratum )
|
||||
{
|
||||
@@ -1492,6 +1506,37 @@ start:
|
||||
json_decref( val );
|
||||
// store work height in solo
|
||||
get_mininginfo(curl, work);
|
||||
|
||||
applog( LOG_BLUE, "%s %s block %d, diff %.5g", algo_names[ opt_algo ],
|
||||
short_url, work->height, net_diff );
|
||||
|
||||
if ( !opt_quiet && net_diff && net_hashrate )
|
||||
{
|
||||
double miner_hr = 0.;
|
||||
pthread_mutex_lock( &stats_lock );
|
||||
|
||||
for ( int i = 0; i < opt_n_threads; i++ )
|
||||
miner_hr += thr_hashrates[i];
|
||||
global_hashrate = miner_hr;
|
||||
|
||||
pthread_mutex_unlock( &stats_lock );
|
||||
|
||||
if ( miner_hr )
|
||||
{
|
||||
char net_hr_units[4] = {0};
|
||||
char miner_hr_units[4] = {0};
|
||||
char net_ttf[32];
|
||||
char miner_ttf[32];
|
||||
|
||||
sprintf_et( net_ttf, net_diff * diff_to_hash / net_hashrate );
|
||||
sprintf_et( miner_ttf, net_diff * diff_to_hash / miner_hr );
|
||||
scale_hash_for_display ( &miner_hr, miner_hr_units );
|
||||
scale_hash_for_display ( &net_hashrate, net_hr_units );
|
||||
applog2(LOG_INFO, "Miner TTF @ %.2f %sh/s %s, net TTF @ %.2f %sh/s %s",
|
||||
miner_hr, miner_hr_units, miner_ttf,
|
||||
net_hashrate, net_hr_units, net_ttf );
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -1538,6 +1583,8 @@ static bool workio_get_work(struct workio_cmd *wc, CURL *curl)
|
||||
sleep(opt_fail_pause);
|
||||
}
|
||||
|
||||
report_summary_log( false );
|
||||
|
||||
/* send work to requesting thread */
|
||||
if (!tq_push(wc->thr->q, ret_work))
|
||||
free(ret_work);
|
||||
@@ -1713,12 +1760,8 @@ void work_set_target_ratio( struct work* work, const void *hash )
|
||||
share_stats[ s_put_ptr ].net_diff = net_diff;
|
||||
share_stats[ s_put_ptr ].stratum_diff = stratum_diff;
|
||||
share_stats[ s_put_ptr ].target_diff = work->targetdiff;
|
||||
|
||||
|
||||
//purge job id when solo
|
||||
if ( have_stratum )
|
||||
strncpy( share_stats[ s_put_ptr ].job_id, work->job_id, 30 );
|
||||
|
||||
s_put_ptr = stats_ptr_incr( s_put_ptr );
|
||||
|
||||
pthread_mutex_unlock( &stats_lock );
|
||||
@@ -1731,7 +1774,7 @@ bool submit_solution( struct work *work, const void *hash,
|
||||
{
|
||||
submitted_share_count++;
|
||||
work_set_target_ratio( work, hash );
|
||||
//purge job id when solo
|
||||
|
||||
if ( !opt_quiet )
|
||||
{
|
||||
if ( have_stratum )
|
||||
@@ -1742,20 +1785,20 @@ bool submit_solution( struct work *work, const void *hash,
|
||||
submitted_share_count, thr->id );
|
||||
}
|
||||
|
||||
if ( lowdiff_debug )
|
||||
{
|
||||
uint32_t* h = (uint32_t*)hash;
|
||||
uint32_t* t = (uint32_t*)work->target;
|
||||
applog(LOG_INFO,"Hash[7:0]: %08x %08x %08x %08x %08x %08x %08x %08x",
|
||||
h[7],h[6],h[5],h[4],h[3],h[2],h[1],h[0]);
|
||||
applog(LOG_INFO,"Targ[7:0]: %08x %08x %08x %08x %08x %08x %08x %08x",
|
||||
t[7],t[6],t[5],t[4],t[3],t[2],t[1],t[0]);
|
||||
}
|
||||
return true;
|
||||
if ( lowdiff_debug )
|
||||
{
|
||||
uint32_t* h = (uint32_t*)hash;
|
||||
uint32_t* t = (uint32_t*)work->target;
|
||||
applog(LOG_INFO,"Hash[7:0]: %08x %08x %08x %08x %08x %08x %08x %08x",
|
||||
h[7],h[6],h[5],h[4],h[3],h[2],h[1],h[0]);
|
||||
applog(LOG_INFO,"Targ[7:0]: %08x %08x %08x %08x %08x %08x %08x %08x",
|
||||
t[7],t[6],t[5],t[4],t[3],t[2],t[1],t[0]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
applog( LOG_WARNING, "%d failed to submit share.",
|
||||
submitted_share_count );
|
||||
applog( LOG_WARNING, "%d failed to submit share thread %d.",
|
||||
submitted_share_count, thr->id );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1766,7 +1809,7 @@ bool submit_lane_solution( struct work *work, const void *hash,
|
||||
{
|
||||
submitted_share_count++;
|
||||
work_set_target_ratio( work, hash );
|
||||
//purge job id when solo
|
||||
|
||||
if ( !opt_quiet )
|
||||
{
|
||||
if ( have_stratum )
|
||||
@@ -1777,22 +1820,20 @@ bool submit_lane_solution( struct work *work, const void *hash,
|
||||
submitted_share_count, thr->id, lane );
|
||||
}
|
||||
|
||||
if ( lowdiff_debug )
|
||||
{
|
||||
uint32_t* h = (uint32_t*)hash;
|
||||
uint32_t* t = (uint32_t*)work->target;
|
||||
applog(LOG_INFO,"Hash[7:0]: %08x %08x %08x %08x %08x %08x %08x %08x",
|
||||
h[7],h[6],h[5],h[4],h[3],h[2],h[1],h[0]);
|
||||
applog(LOG_INFO,"Targ[7:0]: %08x %08x %08x %08x %08x %08x %08x %08x",
|
||||
t[7],t[6],t[5],t[4],t[3],t[2],t[1],t[0]);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
if ( lowdiff_debug )
|
||||
{
|
||||
uint32_t* h = (uint32_t*)hash;
|
||||
uint32_t* t = (uint32_t*)work->target;
|
||||
applog(LOG_INFO,"Hash[7:0]: %08x %08x %08x %08x %08x %08x %08x %08x",
|
||||
h[7],h[6],h[5],h[4],h[3],h[2],h[1],h[0]);
|
||||
applog(LOG_INFO,"Targ[7:0]: %08x %08x %08x %08x %08x %08x %08x %08x",
|
||||
t[7],t[6],t[5],t[4],t[3],t[2],t[1],t[0]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
applog( LOG_WARNING, "%d failed to submit share.",
|
||||
submitted_share_count );
|
||||
applog( LOG_WARNING, "%d failed to submit share, thread %d, lane %d.",
|
||||
submitted_share_count, thr->id, lane );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1886,17 +1927,15 @@ void std_get_new_work( struct work* work, struct work* g_work, int thr_id,
|
||||
uint32_t *end_nonce_ptr )
|
||||
{
|
||||
uint32_t *nonceptr = work->data + algo_gate.nonce_index;
|
||||
bool force_new_work = false;
|
||||
|
||||
//purge job id when solo
|
||||
bool force_new_work;
|
||||
if ( have_stratum )
|
||||
force_new_work = work->job_id ? strtoul( work->job_id, NULL, 16 )
|
||||
!= strtoul( g_work->job_id, NULL, 16 )
|
||||
: true;
|
||||
else
|
||||
force_new_work = false;
|
||||
: false;
|
||||
|
||||
if ( force_new_work || *nonceptr >= *end_nonce_ptr )
|
||||
if ( force_new_work || ( *nonceptr >= *end_nonce_ptr )
|
||||
|| memcmp( work->data, g_work->data, algo_gate.work_cmp_size ) )
|
||||
{
|
||||
work_free( work );
|
||||
work_copy( work, g_work );
|
||||
@@ -2266,6 +2305,8 @@ void restart_threads(void)
|
||||
{
|
||||
for ( int i = 0; i < opt_n_threads; i++)
|
||||
work_restart[i].restart = 1;
|
||||
if ( opt_debug )
|
||||
applog( LOG_INFO, "Threads restarted for new work.");
|
||||
}
|
||||
|
||||
json_t *std_longpoll_rpc_call( CURL *curl, int *err, char* lp_url )
|
||||
|
Reference in New Issue
Block a user