From 9626e3a4281bd3e737f569076626342626b37813 Mon Sep 17 00:00:00 2001 From: fizzisist Date: Thu, 18 Oct 2012 10:02:50 -0700 Subject: [PATCH 1/3] Fix units of "value" Units of BTC/MkeyHr are meaningless. Change them to BTC/Mkey (expected earnings per million keys generated). --- oclvanityminer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/oclvanityminer.c b/oclvanityminer.c index 096552c..ebfe343 100644 --- a/oclvanityminer.c +++ b/oclvanityminer.c @@ -319,7 +319,7 @@ server_workitem_new(server_request_t *reqp, wip->addrtype = addrtype; wip->difficulty = difficulty; wip->reward = reward; - wip->value = (reward * 1000000.0 * 3600.0) / difficulty; + wip->value = (reward * 1000000.0) / difficulty; return wip; } @@ -554,13 +554,13 @@ dump_work(avl_root_t *work) wip != NULL; wip = workitem_avl_next(wip)) { printf("Pattern: \"%s\" Reward: %f " - "Value: %f BTC/MkeyHr\n", + "Value: %f BTC/Mkey\n", wip->pattern, wip->reward, wip->value); } if (pbatch->nitems > 1) - printf("Batch of %d, total value: %f BTC/MkeyHr\n", + printf("Batch of %d, total value: %f BTC/Mkey\n", pbatch->nitems, pbatch->total_value); } } @@ -1022,7 +1022,7 @@ main(int argc, char **argv) wip = workitem_avl_next(wip)) { fprintf(stderr, "Searching for pattern: \"%s\" " - "Reward: %f Value: %f BTC/MkeyHr\n", + "Reward: %f Value: %f BTC/Mkey\n", wip->pattern, wip->reward, wip->value); From aa7ac184f9f7d66f587dad19eff8e8722c0f570c Mon Sep 17 00:00:00 2001 From: fizzisist Date: Sun, 21 Oct 2012 02:57:31 -0700 Subject: [PATCH 2/3] 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; From 9981bbeed126a38543a4a869d4a6da957f3a8526 Mon Sep 17 00:00:00 2001 From: fizzisist Date: Sun, 21 Oct 2012 19:59:00 -0700 Subject: [PATCH 3/3] Change BTC/Mkey to BTC/Gkey --- oclvanityminer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/oclvanityminer.c b/oclvanityminer.c index 06aa2a6..76e654c 100644 --- a/oclvanityminer.c +++ b/oclvanityminer.c @@ -319,7 +319,7 @@ server_workitem_new(server_request_t *reqp, wip->addrtype = addrtype; wip->difficulty = difficulty; wip->reward = reward; - wip->value = (reward * 1000000.0) / difficulty; + wip->value = (reward * 1000000000.0) / difficulty; return wip; } @@ -554,13 +554,13 @@ dump_work(avl_root_t *work) wip != NULL; wip = workitem_avl_next(wip)) { printf("Pattern: \"%s\" Reward: %f " - "Value: %f BTC/Mkey\n", + "Value: %f BTC/Gkey\n", wip->pattern, wip->reward, wip->value); } if (pbatch->nitems > 1) - printf("Batch of %d, total value: %f BTC/Mkey\n", + printf("Batch of %d, total value: %f BTC/Gkey\n", pbatch->nitems, pbatch->total_value); } } @@ -1024,7 +1024,7 @@ main(int argc, char **argv) wip = workitem_avl_next(wip)) { fprintf(stderr, "Searching for pattern: \"%s\" " - "Reward: %f Value: %f BTC/Mkey\n", + "Reward: %f Value: %f BTC/Gkey\n", wip->pattern, wip->reward, wip->value); @@ -1043,7 +1043,7 @@ main(int argc, char **argv) } fprintf(stderr, - "\nTotal value for current work: %f BTC/Mkey\n", + "\nTotal value for current work: %f BTC/Gkey\n", active_pkb_value); res = vg_context_start_threads(vcp); if (res)