From aa7ac184f9f7d66f587dad19eff8e8722c0f570c Mon Sep 17 00:00:00 2001 From: fizzisist Date: Sun, 21 Oct 2012 02:57:31 -0700 Subject: [PATCH] Display total value for selected work After selecting the work (pubkeybatch), display the total value in BTC/Mkey so that the user has an idea what their expected earnings are. --- oclvanityminer.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/oclvanityminer.c b/oclvanityminer.c index ebfe343..06aa2a6 100644 --- a/oclvanityminer.c +++ b/oclvanityminer.c @@ -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; @@ -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; @@ -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;