From 19cc88d10256afd1df67b184e2f926f66eae9f61 Mon Sep 17 00:00:00 2001 From: Jay D Dee Date: Sat, 26 Jun 2021 12:27:44 -0400 Subject: [PATCH] v3.16.5 --- RELEASE_NOTES | 5 +++++ configure | 20 ++++++++++---------- configure.ac | 2 +- cpu-miner.c | 11 ++++++++--- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index bf9aec5..a500a8d 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -65,6 +65,11 @@ If not what makes it happen or not happen? Change Log ---------- +v3.16.5 + +#329: Fixed GBT incorrect target diff in stats, second attempt. +Fixed formatting error in share result log when --no-color option is used. + v3.16.4 Faster sha512 and sha256 when not using SHA CPU extension. diff --git a/configure b/configure index 00e7ac3..403892f 100755 --- a/configure +++ b/configure @@ -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.16.4. +# Generated by GNU Autoconf 2.69 for cpuminer-opt 3.16.5. # # # 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.16.4' -PACKAGE_STRING='cpuminer-opt 3.16.4' +PACKAGE_VERSION='3.16.5' +PACKAGE_STRING='cpuminer-opt 3.16.5' 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.16.4 to adapt to many kinds of systems. +\`configure' configures cpuminer-opt 3.16.5 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.16.4:";; + short | recursive ) echo "Configuration of cpuminer-opt 3.16.5:";; 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.16.4 +cpuminer-opt configure 3.16.5 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.16.4, which was +It was created by cpuminer-opt $as_me 3.16.5, 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.16.4' + VERSION='3.16.5' 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.16.4, which was +This file was extended by cpuminer-opt $as_me 3.16.5, 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.16.4 +cpuminer-opt config.status 3.16.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 6a4059d..c0aca33 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([cpuminer-opt], [3.16.4]) +AC_INIT([cpuminer-opt], [3.16.5]) AC_PREREQ([2.59c]) AC_CANONICAL_SYSTEM diff --git a/cpu-miner.c b/cpu-miner.c index 26e48b9..e46d920 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -484,13 +484,17 @@ static bool get_mininginfo( CURL *curl, struct work *work ) // "networkhashps": 56475980 if ( res ) { + // net_diff is a global that is set from the work hash target by + // both getwork and GBT. Don't overwrite it, define a local to override + // the global. + double net_diff = 0.; 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 = work->targetdiff = json_real_value( key ); + net_diff = json_real_value( key ); } key = json_object_get( res, "networkhashps" ); @@ -1168,7 +1172,8 @@ static int share_result( int result, struct work *work, char bres[48]; bool solved = false; bool stale = false; - char *acol = NULL, *bcol = NULL, *scol = NULL, *rcol = NULL; + char *acol, *bcol, *scol, *rcol; + acol = bcol = scol = rcol = "\0"; pthread_mutex_lock( &stats_lock ); @@ -1210,7 +1215,7 @@ static int share_result( int result, struct work *work, 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 ) ) + && ( my_stats.share_diff >= my_stats.net_diff ) ) { solved = true; solved_block_count++;