Skip to content

Commit

Permalink
Display total value for selected work
Browse files Browse the repository at this point in the history
After selecting the work (pubkeybatch), display the total value in
BTC/Mkey so that the user has an idea what their expected earnings are.
  • Loading branch information
fizzisist committed Oct 21, 2012
1 parent 9626e3a commit aa7ac18
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions oclvanityminer.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ main(int argc, char **argv)
int res;
int thread_started = 0;
pubkeybatch_t *active_pkb = NULL;
float active_pkb_value = 0;

server_context_t *scp = NULL;
pubkeybatch_t *pkb;
Expand Down Expand Up @@ -1016,6 +1017,7 @@ main(int argc, char **argv)
} else if (!active_pkb) {
workitem_t *wip;
was_sleeping = 0;
active_pkb_value = 0;
vcp->vc_pubkey_base = pkb->pubkey;
for (wip = workitem_avl_first(&pkb->items);
wip != NULL;
Expand All @@ -1033,9 +1035,16 @@ main(int argc, char **argv)
fprintf(stderr,
"WARNING: could not add pattern\n");
}
else {
active_pkb_value += wip->value;
}

assert(vcp->vc_npatterns);
}

fprintf(stderr,
"\nTotal value for current work: %f BTC/Mkey\n",
active_pkb_value);
res = vg_context_start_threads(vcp);
if (res)
return 1;
Expand Down

0 comments on commit aa7ac18

Please sign in to comment.