@ -1018,6 +1018,12 @@ static char *set_algo(const char *arg)
return NULL ;
return NULL ;
}
}
static char * set_nfactor ( const char * arg )
{
set_algorithm_nfactor ( algorithm , ( uint8_t ) atoi ( arg ) ) ;
return NULL ;
}
static char * set_api_allow ( const char * arg )
static char * set_api_allow ( const char * arg )
{
{
opt_set_charp ( arg , & opt_api_allow ) ;
opt_set_charp ( arg , & opt_api_allow ) ;
@ -1069,7 +1075,7 @@ static char *set_null(const char __maybe_unused *arg)
static struct opt_table opt_config_table [ ] = {
static struct opt_table opt_config_table [ ] = {
OPT_WITH_ARG ( " --algorithm " ,
OPT_WITH_ARG ( " --algorithm " ,
set_algo , NULL , NULL ,
set_algo , NULL , NULL ,
" Set mining algorithm to most common defaults, default: static " ) ,
" Set mining algorithm and most common defaults, default: static " ) ,
OPT_WITH_ARG ( " --api-allow " ,
OPT_WITH_ARG ( " --api-allow " ,
set_api_allow , NULL , NULL ,
set_api_allow , NULL , NULL ,
" Allow API access only to the given list of [G:]IP[/Prefix] addresses[/subnets] " ) ,
" Allow API access only to the given list of [G:]IP[/Prefix] addresses[/subnets] " ) ,
@ -1122,9 +1128,6 @@ static struct opt_table opt_config_table[] = {
opt_set_bool , & opt_compact ,
opt_set_bool , & opt_compact ,
" Use compact display without per device statistics " ) ,
" Use compact display without per device statistics " ) ,
# endif
# endif
OPT_WITH_ARG ( " --nfactor " ,
set_int_0_to_9999 , opt_show_intval , & opt_nfactor ,
" Set scrypt N-factor parameter, default: 10. Currently use 11 for vertcoin! " ) ,
OPT_WITHOUT_ARG ( " --debug|-D " ,
OPT_WITHOUT_ARG ( " --debug|-D " ,
enable_debug , & opt_debug ,
enable_debug , & opt_debug ,
" Enable debug output " ) ,
" Enable debug output " ) ,
@ -1228,6 +1231,9 @@ static struct opt_table opt_config_table[] = {
OPT_WITHOUT_ARG ( " --net-delay " ,
OPT_WITHOUT_ARG ( " --net-delay " ,
opt_set_bool , & opt_delaynet ,
opt_set_bool , & opt_delaynet ,
" Impose small delays in networking to not overload slow routers " ) ,
" Impose small delays in networking to not overload slow routers " ) ,
OPT_WITH_ARG ( " --nfactor " ,
set_nfactor , NULL , NULL ,
" Override default scrypt N-factor parameter. " ) ,
# ifdef HAVE_ADL
# ifdef HAVE_ADL
OPT_WITHOUT_ARG ( " --no-adl " ,
OPT_WITHOUT_ARG ( " --no-adl " ,
opt_set_bool , & opt_noadl ,
opt_set_bool , & opt_noadl ,
@ -7764,7 +7770,7 @@ int main(int argc, char *argv[])
int i , j ;
int i , j ;
char * s ;
char * s ;
/* This dangerous functions tramples random dynamically allocated
/* This dangerous function tramples random dynamically allocated
* variables so do it before anything at all */
* variables so do it before anything at all */
if ( unlikely ( curl_global_init ( CURL_GLOBAL_ALL ) ) )
if ( unlikely ( curl_global_init ( CURL_GLOBAL_ALL ) ) )
quit ( 1 , " Failed to curl_global_init " ) ;
quit ( 1 , " Failed to curl_global_init " ) ;
@ -7842,6 +7848,8 @@ int main(int argc, char *argv[])
strcat ( sgminer_path , " \\ " ) ;
strcat ( sgminer_path , " \\ " ) ;
# endif
# endif
algorithm = ( algorithm_t * ) alloca ( sizeof ( algorithm_t ) ) ;
devcursor = 8 ;
devcursor = 8 ;
logstart = devcursor + 1 ;
logstart = devcursor + 1 ;
logcursor = logstart + 1 ;
logcursor = logstart + 1 ;