|
|
@ -150,6 +150,7 @@ int opt_tcp_keepalive = 30; |
|
|
|
#else |
|
|
|
#else |
|
|
|
int opt_tcp_keepalive; |
|
|
|
int opt_tcp_keepalive; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
double opt_diff_mult = 1.0; |
|
|
|
|
|
|
|
|
|
|
|
char *opt_kernel_path; |
|
|
|
char *opt_kernel_path; |
|
|
|
char *sgminer_path; |
|
|
|
char *sgminer_path; |
|
|
@ -1055,6 +1056,18 @@ static char *set_null(const char __maybe_unused *arg) |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char *set_difficulty_multiplier(char *arg) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
char **endptr = NULL; |
|
|
|
|
|
|
|
if (!(arg && arg[0])) |
|
|
|
|
|
|
|
return "Invalid parameters for set difficulty multiplier"; |
|
|
|
|
|
|
|
opt_diff_mult = strtod(arg, endptr); |
|
|
|
|
|
|
|
if (opt_diff_mult == 0 || endptr == arg) |
|
|
|
|
|
|
|
return "Invalid value passed to set difficulty multiplier"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* These options are available from config file or commandline */ |
|
|
|
/* These options are available from config file or commandline */ |
|
|
|
static struct opt_table opt_config_table[] = { |
|
|
|
static struct opt_table opt_config_table[] = { |
|
|
|
OPT_WITH_ARG("--api-allow", |
|
|
|
OPT_WITH_ARG("--api-allow", |
|
|
@ -1354,6 +1367,9 @@ static struct opt_table opt_config_table[] = { |
|
|
|
"Display extra work time debug information"), |
|
|
|
"Display extra work time debug information"), |
|
|
|
OPT_WITH_ARG("--pools", |
|
|
|
OPT_WITH_ARG("--pools", |
|
|
|
opt_set_bool, NULL, NULL, opt_hidden), |
|
|
|
opt_set_bool, NULL, NULL, opt_hidden), |
|
|
|
|
|
|
|
OPT_WITH_ARG("--difficulty-multiplier", |
|
|
|
|
|
|
|
set_difficulty_multiplier, NULL, NULL, |
|
|
|
|
|
|
|
"Difficulty multiplier for jobs received from stratum pools"), |
|
|
|
OPT_ENDTABLE |
|
|
|
OPT_ENDTABLE |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -5908,7 +5924,10 @@ static void gen_stratum_work(struct pool *pool, struct work *work) |
|
|
|
cg_dwlock(&pool->data_lock); |
|
|
|
cg_dwlock(&pool->data_lock); |
|
|
|
|
|
|
|
|
|
|
|
/* Generate merkle root */ |
|
|
|
/* Generate merkle root */ |
|
|
|
gen_hash(pool->coinbase, merkle_root, pool->swork.cb_len); |
|
|
|
if (gpus[0].kernel == KL_FUGUECOIN || gpus[0].kernel == KL_GROESTLCOIN || gpus[0].kernel == KL_TWECOIN) |
|
|
|
|
|
|
|
sha256(pool->coinbase, pool->swork.cb_len, merkle_root); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
gen_hash(pool->coinbase, merkle_root, pool->swork.cb_len); |
|
|
|
memcpy(merkle_sha, merkle_root, 32); |
|
|
|
memcpy(merkle_sha, merkle_root, 32); |
|
|
|
for (i = 0; i < pool->swork.merkles; i++) { |
|
|
|
for (i = 0; i < pool->swork.merkles; i++) { |
|
|
|
memcpy(merkle_sha + 32, pool->swork.merkle_bin[i], 32); |
|
|
|
memcpy(merkle_sha + 32, pool->swork.merkle_bin[i], 32); |
|
|
|