Browse Source

Use doubles for per client diffs and display the total accepted hashes in the console log

master
Con Kolivas 11 years ago
parent
commit
21e6b2704e
  1. 16
      src/stratifier.c

16
src/stratifier.c

@ -175,8 +175,8 @@ struct stratum_instance {
char enonce1var[12]; char enonce1var[12];
uint64_t enonce1_64; uint64_t enonce1_64;
int diff; /* Current diff */ double diff; /* Current diff */
int old_diff; /* Previous diff */ double old_diff; /* Previous diff */
uint64_t diff_change_job_id; /* Last job_id we changed diff */ uint64_t diff_change_job_id; /* Last job_id we changed diff */
double dsps5; /* Diff shares per second, 5 minute rolling average */ double dsps5; /* Diff shares per second, 5 minute rolling average */
tv_t ldc; /* Last diff change */ tv_t ldc; /* Last diff change */
@ -184,7 +184,7 @@ struct stratum_instance {
tv_t first_share; tv_t first_share;
tv_t last_share; tv_t last_share;
int absolute_shares; int absolute_shares;
int diff_shares; double diff_shares;
bool authorised; bool authorised;
@ -1017,9 +1017,8 @@ static double time_bias(double tdiff, double period)
static void add_submit(stratum_instance_t *client, int diff, bool valid) static void add_submit(stratum_instance_t *client, int diff, bool valid)
{ {
double tdiff, bdiff, dsps, drr, network_diff, bias; double optimal, tdiff, bdiff, dsps, drr, network_diff, bias;
uint64_t next_blockid; uint64_t next_blockid;
int optimal;
tv_t now_t; tv_t now_t;
if (valid) { if (valid) {
@ -1061,8 +1060,9 @@ static void add_submit(stratum_instance_t *client, int diff, bool valid)
/* FIXME For now show the hashrate every ~1m when the diff is /* FIXME For now show the hashrate every ~1m when the diff is
* stable */ * stable */
if (!(client->ssdc % 18)) { if (!(client->ssdc % 18)) {
LOGNOTICE("Client %d worker %s hashrate %.1fGH/s", client->id, LOGNOTICE("Client %d worker %s DiffAcc: %.0f hashrate %.1fGH/s",
client->workername, dsps * 4.294967296); client->id, client->workername, client->diff_shares,
dsps * 4.294967296);
} }
return; return;
} }
@ -1091,7 +1091,7 @@ static void add_submit(stratum_instance_t *client, int diff, bool valid)
client->ssdc = 0; client->ssdc = 0;
LOGINFO("Client %d biased dsps %.2f dsps %.2f drr %.2f adjust diff from %d to: %d ", LOGINFO("Client %d biased dsps %.2f dsps %.2f drr %.2f adjust diff from %.0f to: %.0f ",
client->id, dsps, client->dsps5, drr, client->diff, optimal); client->id, dsps, client->dsps5, drr, client->diff, optimal);
copy_tv(&client->ldc, &now_t); copy_tv(&client->ldc, &now_t);

Loading…
Cancel
Save