Skip to content

Commit

Permalink
v3.12.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
JayDDee committed Feb 22, 2020
1 parent 6d66051 commit dbce7e0
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 19 deletions.
7 changes: 7 additions & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ If not what makes it happen or not happen?
Change Log
----------

v3.12.4.1

Issue #245: fix scantime when mining solo with getwork.

Added debug logs for creation of stratum and longpoll threads, use -D to
enable.

v3.12.4

Issue #244: Change longpoll to ignore job id.
Expand Down
20 changes: 10 additions & 10 deletions configure
Original file line number Diff line number Diff line change
@@ -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.
# Generated by GNU Autoconf 2.69 for cpuminer-opt 3.12.4.1.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -577,8 +577,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='cpuminer-opt'
PACKAGE_TARNAME='cpuminer-opt'
PACKAGE_VERSION='3.12.4'
PACKAGE_STRING='cpuminer-opt 3.12.4'
PACKAGE_VERSION='3.12.4.1'
PACKAGE_STRING='cpuminer-opt 3.12.4.1'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -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 to adapt to many kinds of systems.
\`configure' configures cpuminer-opt 3.12.4.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -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:";;
short | recursive ) echo "Configuration of cpuminer-opt 3.12.4.1:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -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
cpuminer-opt configure 3.12.4.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -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, which was
It was created by cpuminer-opt $as_me 3.12.4.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -2993,7 +2993,7 @@ fi
# Define the identity of the package.
PACKAGE='cpuminer-opt'
VERSION='3.12.4'
VERSION='3.12.4.1'
cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -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, which was
This file was extended by cpuminer-opt $as_me 3.12.4.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -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
cpuminer-opt config.status 3.12.4.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([cpuminer-opt], [3.12.4])
AC_INIT([cpuminer-opt], [3.12.4.1])

AC_PREREQ([2.59c])
AC_CANONICAL_SYSTEM
Expand Down
44 changes: 36 additions & 8 deletions cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -2074,12 +2074,28 @@ static void *miner_thread( void *userdata )
sleep(5);
continue;
}
// adjust max_nonce to meet target scan time

// LP_SCANTIME overrides opt_scantime option, is this right?

// adjust max_nonce to meet target scan time. Startum and longpoll
// can go longer because they can rely on restart_threads to signal
// an early abort. get_work on the other hand can't rely on
// restart_threads so need a much shorter scantime
if ( have_stratum )
max64 = 60 * thr_hashrates[thr_id];
else if ( have_longpoll )
max64 = LP_SCANTIME * thr_hashrates[thr_id];
else // getwork inline
max64 = opt_scantime * thr_hashrates[thr_id];

/*
if ( have_stratum )
max64 = LP_SCANTIME;
else
max64 = g_work_time + ( have_longpoll ? LP_SCANTIME : opt_scantime )
- time(NULL);
*/

// time limit
if ( unlikely( opt_time_limit && firstwork_time ) )
{
Expand All @@ -2106,17 +2122,20 @@ static void *miner_thread( void *userdata )
}
if ( remain < max64 ) max64 = remain;
}
// Select nonce range for approx 1 min duration based
// on hashrate, initial value arbitrarilly set to 1000 just to get

// Select nonce range based on max64, the estimated number of hashes
// to meet the desired scan time.
// Initial value arbitrarilly set to 1000 just to get
// a sample hashrate for the next time.
uint32_t work_nonce = *nonceptr;
max64 = 60 * thr_hashrates[thr_id];
// max64 = 60 * thr_hashrates[thr_id];
if ( max64 <= 0)
max64 = 1000;
if ( work_nonce + max64 > end_nonce )
max_nonce = end_nonce;
else
max_nonce = work_nonce + (uint32_t)max64;

// init time
if ( firstwork_time == 0 )
firstwork_time = time(NULL);
Expand Down Expand Up @@ -3677,7 +3696,10 @@ int main(int argc, char *argv[])
/* ESET-NOD32 Detects these 2 thread_create... */
if (want_longpoll && !have_stratum)
{
/* init longpoll thread info */
if ( opt_debug )
applog(LOG_INFO,"Creating long poll thread");

/* init longpoll thread info */
longpoll_thr_id = opt_n_threads + 1;
thr = &thr_info[longpoll_thr_id];
thr->id = longpoll_thr_id;
Expand All @@ -3693,7 +3715,10 @@ int main(int argc, char *argv[])
}
if (want_stratum)
{
/* init stratum thread info */
if ( opt_debug )
applog(LOG_INFO,"Creating stratum thread");

/* init stratum thread info */
stratum_thr_id = opt_n_threads + 2;
thr = &thr_info[stratum_thr_id];
thr->id = stratum_thr_id;
Expand All @@ -3713,7 +3738,10 @@ int main(int argc, char *argv[])

if ( opt_api_enabled )
{
/* api thread */
if ( opt_debug )
applog(LOG_INFO,"Creating API thread");

/* api thread */
api_thr_id = opt_n_threads + 3;
thr = &thr_info[api_thr_id];
thr->id = api_thr_id;
Expand All @@ -3723,7 +3751,7 @@ int main(int argc, char *argv[])
err = thread_create( thr, api_thread );
if ( err )
{
applog( LOG_ERR, "api thread create failed" );
applog( LOG_ERR, "API thread create failed" );
return 1;
}
if ( !opt_quiet )
Expand Down

0 comments on commit dbce7e0

Please sign in to comment.