mirror of
https://github.com/JayDDee/cpuminer-opt.git
synced 2025-09-17 23:44:27 +00:00
v3.6.11
This commit is contained in:
@@ -114,8 +114,8 @@ void init_algo_gate( algo_gate_t* gate )
|
||||
gate->stratum_gen_work = (void*)&std_stratum_gen_work;
|
||||
gate->build_stratum_request = (void*)&std_le_build_stratum_request;
|
||||
gate->set_target = (void*)&std_set_target;
|
||||
gate->work_decode = (void*)&std_work_decode;
|
||||
gate->submit_getwork_result = (void*)&std_submit_getwork_result;
|
||||
gate->work_decode = (void*)&std_le_work_decode;
|
||||
gate->submit_getwork_result = (void*)&std_le_submit_getwork_result;
|
||||
gate->build_extraheader = (void*)&std_build_extraheader;
|
||||
gate->set_work_data_endian = (void*)&do_nothing;
|
||||
gate->calc_network_diff = (void*)&std_calc_network_diff;
|
||||
|
||||
@@ -215,10 +215,12 @@ int64_t get_max64_0xffffLL();
|
||||
void std_set_target ( struct work *work, double job_diff );
|
||||
void scrypt_set_target( struct work *work, double job_diff );
|
||||
|
||||
bool std_work_decode( const json_t *val, struct work *work );
|
||||
bool std_le_work_decode( const json_t *val, struct work *work );
|
||||
bool std_be_work_decode( const json_t *val, struct work *work );
|
||||
bool jr2_work_decode( const json_t *val, struct work *work );
|
||||
|
||||
bool std_submit_getwork_result( CURL *curl, struct work *work );
|
||||
bool std_le_submit_getwork_result( CURL *curl, struct work *work );
|
||||
bool std_be_submit_getwork_result( CURL *curl, struct work *work );
|
||||
bool jr2_submit_getwork_result( CURL *curl, struct work *work );
|
||||
|
||||
void std_le_build_stratum_request( char *req, struct work *work );
|
||||
|
||||
@@ -220,6 +220,8 @@ bool register_blake2b_algo( algo_gate_t* gate )
|
||||
gate->hash = (void*)&blake2b_hash;
|
||||
gate->calc_network_diff = (void*)&blake2b_calc_network_diff;
|
||||
gate->build_stratum_request = (void*)&blake2b_be_build_stratum_request;
|
||||
gate->work_decode = (void*)&std_be_work_decode;
|
||||
gate->submit_getwork_result = (void*)&std_be_submit_getwork_result;
|
||||
gate->build_extraheader = (void*)&blake2b_build_extraheader;
|
||||
gate->get_new_work = (void*)&blake2b_get_new_work;
|
||||
gate->get_max64 = (void*)&blake2b_get_max64;
|
||||
|
||||
@@ -274,6 +274,8 @@ bool register_decred_algo( algo_gate_t* gate )
|
||||
gate->get_max64 = (void*)&get_max64_0x3fffffLL;
|
||||
gate->display_extra_data = (void*)&decred_decode_extradata;
|
||||
gate->build_stratum_request = (void*)&decred_be_build_stratum_request;
|
||||
gate->work_decode = (void*)&std_be_work_decode;
|
||||
gate->submit_getwork_result = (void*)&std_be_submit_getwork_result;
|
||||
gate->build_extraheader = (void*)&decred_build_extraheader;
|
||||
gate->ready_to_mine = (void*)&decred_ready_to_mine;
|
||||
gate->nbits_index = DECRED_NBITS_INDEX;
|
||||
|
||||
@@ -248,6 +248,8 @@ bool register_drop_algo( algo_gate_t* gate )
|
||||
gate->get_new_work = (void*)&drop_get_new_work;
|
||||
gate->set_target = (void*)&scrypt_set_target;
|
||||
gate->build_stratum_request = (void*)&std_be_build_stratum_request;
|
||||
gate->work_decode = (void*)&std_be_work_decode;
|
||||
gate->submit_getwork_result = (void*)&std_be_submit_getwork_result;
|
||||
gate->set_work_data_endian = (void*)&swab_work_data;
|
||||
gate->display_extra_data = (void*)&drop_display_pok;
|
||||
gate->work_data_size = 80;
|
||||
|
||||
@@ -372,10 +372,11 @@ bool register_m7m_algo( algo_gate_t *gate )
|
||||
init_m7m_ctx();
|
||||
gate->scanhash = (void*)scanhash_m7m_hash;
|
||||
gate->build_stratum_request = (void*)&std_be_build_stratum_request;
|
||||
gate->work_decode = (void*)&std_be_work_decode;
|
||||
gate->submit_getwork_result = (void*)&std_be_submit_getwork_result;
|
||||
gate->set_target = (void*)&scrypt_set_target;
|
||||
gate->get_max64 = (void*)&get_max64_0x1ffff;
|
||||
gate->set_work_data_endian = (void*)&m7m_reverse_endian;
|
||||
gate->work_data_size = 80;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1089,6 +1089,8 @@ bool register_neoscrypt_algo( algo_gate_t* gate )
|
||||
gate->set_target = (void*)&scrypt_set_target;
|
||||
gate->wait_for_diff = (void*)&neoscrypt_wait_for_diff;
|
||||
gate->build_stratum_request = (void*)&std_be_build_stratum_request;
|
||||
gate->work_decode = (void*)&std_be_work_decode;
|
||||
gate->submit_getwork_result = (void*)&std_be_submit_getwork_result;
|
||||
gate->set_work_data_endian = (void*)&swab_work_data;
|
||||
gate->work_data_size = 80;
|
||||
return true;
|
||||
|
||||
@@ -229,6 +229,8 @@ bool register_zr5_algo( algo_gate_t* gate )
|
||||
gate->get_max64 = (void*)&zr5_get_max64;
|
||||
gate->display_extra_data = (void*)&zr5_display_pok;
|
||||
gate->build_stratum_request = (void*)&std_be_build_stratum_request;
|
||||
gate->work_decode = (void*)&std_be_work_decode;
|
||||
gate->submit_getwork_result = (void*)&std_be_submit_getwork_result;
|
||||
gate->set_work_data_endian = (void*)&swab_work_data;
|
||||
gate->work_data_size = 80;
|
||||
gate->work_cmp_size = 72;
|
||||
|
||||
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.6.10.
|
||||
# Generated by GNU Autoconf 2.69 for cpuminer-opt 3.6.11.
|
||||
#
|
||||
#
|
||||
# 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.6.10'
|
||||
PACKAGE_STRING='cpuminer-opt 3.6.10'
|
||||
PACKAGE_VERSION='3.6.11'
|
||||
PACKAGE_STRING='cpuminer-opt 3.6.11'
|
||||
PACKAGE_BUGREPORT=''
|
||||
PACKAGE_URL=''
|
||||
|
||||
@@ -1321,7 +1321,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.6.10 to adapt to many kinds of systems.
|
||||
\`configure' configures cpuminer-opt 3.6.11 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1392,7 +1392,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of cpuminer-opt 3.6.10:";;
|
||||
short | recursive ) echo "Configuration of cpuminer-opt 3.6.11:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1497,7 +1497,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
cpuminer-opt configure 3.6.10
|
||||
cpuminer-opt configure 3.6.11
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@@ -2000,7 +2000,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.6.10, which was
|
||||
It was created by cpuminer-opt $as_me 3.6.11, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -2981,7 +2981,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='cpuminer-opt'
|
||||
VERSION='3.6.10'
|
||||
VERSION='3.6.11'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -6677,7 +6677,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.6.10, which was
|
||||
This file was extended by cpuminer-opt $as_me 3.6.11, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -6743,7 +6743,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.6.10
|
||||
cpuminer-opt config.status 3.6.11
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
AC_INIT([cpuminer-opt], [3.6.10])
|
||||
AC_INIT([cpuminer-opt], [3.6.11])
|
||||
|
||||
AC_PREREQ([2.59c])
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
64
cpu-miner.c
64
cpu-miner.c
@@ -279,7 +279,7 @@ void work_copy(struct work *dest, const struct work *src)
|
||||
bool jr2_work_decode( const json_t *val, struct work *work )
|
||||
{ return rpc2_job_decode( val, work ); }
|
||||
|
||||
bool std_work_decode( const json_t *val, struct work *work )
|
||||
bool std_le_work_decode( const json_t *val, struct work *work )
|
||||
{
|
||||
int i;
|
||||
const int data_size = algo_gate.work_data_size;
|
||||
@@ -304,6 +304,31 @@ bool std_work_decode( const json_t *val, struct work *work )
|
||||
return true;
|
||||
}
|
||||
|
||||
bool std_be_work_decode( const json_t *val, struct work *work )
|
||||
{
|
||||
int i;
|
||||
const int data_size = algo_gate.work_data_size;
|
||||
const int target_size = sizeof(work->target);
|
||||
const int adata_sz = data_size / 4;
|
||||
const int atarget_sz = ARRAY_SIZE(work->target);
|
||||
|
||||
if (unlikely( !jobj_binary(val, "data", work->data, data_size) ))
|
||||
{
|
||||
applog(LOG_ERR, "JSON invalid data");
|
||||
return false;
|
||||
}
|
||||
if (unlikely( !jobj_binary(val, "target", work->target, target_size) ))
|
||||
{
|
||||
applog(LOG_ERR, "JSON invalid target");
|
||||
return false;
|
||||
}
|
||||
for ( i = 0; i < adata_sz; i++ )
|
||||
work->data[i] = be32dec( work->data + i );
|
||||
for ( i = 0; i < atarget_sz; i++ )
|
||||
work->target[i] = be32dec( work->target + i );
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool work_decode( const json_t *val, struct work *work )
|
||||
{
|
||||
if ( !algo_gate.work_decode( val, work ) )
|
||||
@@ -852,7 +877,7 @@ void jr2_build_stratum_request( char *req, struct work *work )
|
||||
free( hashhex );
|
||||
}
|
||||
|
||||
bool std_submit_getwork_result( CURL *curl, struct work *work )
|
||||
bool std_le_submit_getwork_result( CURL *curl, struct work *work )
|
||||
{
|
||||
char req[JSON_BUF_LEN];
|
||||
json_t *val, *res, *reason;
|
||||
@@ -886,6 +911,41 @@ bool std_submit_getwork_result( CURL *curl, struct work *work )
|
||||
return true;
|
||||
}
|
||||
|
||||
bool std_be_submit_getwork_result( CURL *curl, struct work *work )
|
||||
{
|
||||
char req[JSON_BUF_LEN];
|
||||
json_t *val, *res, *reason;
|
||||
char* gw_str;
|
||||
int data_size = algo_gate.work_data_size;
|
||||
|
||||
for ( int i = 0; i < data_size / sizeof(uint32_t); i++ )
|
||||
be32enc( &work->data[i], work->data[i] );
|
||||
gw_str = abin2hex( (uchar*)work->data, data_size );
|
||||
if ( unlikely(!gw_str) )
|
||||
{
|
||||
applog(LOG_ERR, "submit_upstream_work OOM");
|
||||
return false;
|
||||
}
|
||||
// build JSON-RPC request
|
||||
snprintf( req, JSON_BUF_LEN,
|
||||
"{\"method\": \"getwork\", \"params\": [\"%s\"], \"id\":4}\r\n", gw_str );
|
||||
free( gw_str );
|
||||
// issue JSON-RPC request
|
||||
val = json_rpc_call( curl, rpc_url, rpc_userpass, req, NULL, 0 );
|
||||
if ( unlikely(!val) )
|
||||
{
|
||||
applog(LOG_ERR, "submit_upstream_work json_rpc_call failed");
|
||||
return false;
|
||||
}
|
||||
res = json_object_get( val, "result" );
|
||||
reason = json_object_get( val, "reject-reason" );
|
||||
share_result( json_is_true( res ), work,
|
||||
reason ? json_string_value( reason ) : NULL );
|
||||
json_decref( val );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool jr2_submit_getwork_result( CURL *curl, struct work *work )
|
||||
{
|
||||
json_t *val, *res;
|
||||
|
||||
Reference in New Issue
Block a user