In the unlikely event of finding a block, display the block solved count with the pool it came from for auditing.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
diff --git a/cgminer.c b/cgminer.c
index 3d511ef..99c3d46 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -1640,8 +1640,10 @@ static bool submit_upstream_work(const struct work *work, CURL *curl)
#ifndef MIPSEB
// This one segfaults on my router for some reason
isblock = regeneratehash(work);
- if (isblock)
+ if (unlikely(isblock)) {
+ pool->solved++;
found_blocks++;
+ }
hash32 = (uint32_t *)(work->hash);
sprintf(hashshow, "%08lx.%08lx%s", (unsigned long)(hash32[6]), (unsigned long)(hash32[5]),
isblock ? " BLOCK!" : "");
@@ -2575,7 +2577,9 @@ static void display_pool_summary(struct pool *pool)
if (curses_active_locked()) {
wlog("Pool: %s\n", pool->rpc_url);
- wlog("%s long-poll support\n", pool->hdr_path ? "Has" : "Does not have");
+ if (pool->solved)
+ wlog("SOLVED %d BLOCK%s!\n", pool->solved, pool->solved > 1 ? "S" : "");
+ wlog("%s own long-poll support\n", pool->hdr_path ? "Has" : "Does not have");
wlog(" Queued work requests: %d\n", pool->getwork_requested);
wlog(" Share submissions: %d\n", pool->accepted + pool->rejected);
wlog(" Accepted shares: %d\n", pool->accepted);
@@ -4365,6 +4369,8 @@ static void print_summary(void)
struct pool *pool = pools[i];
applog(LOG_WARNING, "Pool: %s", pool->rpc_url);
+ if (pool->solved)
+ applog(LOG_WARNING, "SOLVED %d BLOCK%s!", pool->solved, pool->solved > 1 ? "S" : "");
applog(LOG_WARNING, " Queued work requests: %d", pool->getwork_requested);
applog(LOG_WARNING, " Share submissions: %d", pool->accepted + pool->rejected);
applog(LOG_WARNING, " Accepted shares: %d", pool->accepted);
diff --git a/miner.h b/miner.h
index b11ec7b..0901d23 100644
--- a/miner.h
+++ b/miner.h
@@ -629,6 +629,7 @@ struct pool {
int prio;
int accepted, rejected;
int seq_rejects;
+ int solved;
bool submit_fail;
bool idle;