Browse Source

Merge commit '784a41c' into stratum

Luke Dashjr 13 years ago
parent
commit
5e839ec2e8
2 changed files with 20 additions and 6 deletions
  1. 9 0
      README
  2. 11 6
      miner.c

+ 9 - 0
README

@@ -445,6 +445,15 @@ diminish return performance even if the hash rate might appear better. A good
 starting baseline intensity to try on dedicated miners is 9. Higher values are
 starting baseline intensity to try on dedicated miners is 9. Higher values are
 there to cope with future improvements in hardware.
 there to cope with future improvements in hardware.
 
 
+
+The block display shows:
+Block: 0074c5e482e34a506d2a051a...  Started: [17:17:22]  Best share: 2.71K
+
+This shows a short stretch of the current block, when the new block started,
+and the all time best difficulty share you've submitted since starting cgminer
+this time.
+
+
 ---
 ---
 MULTIPOOL
 MULTIPOOL
 
 

+ 11 - 6
miner.c

@@ -244,18 +244,18 @@ const
 #endif
 #endif
 bool curses_active;
 bool curses_active;
 
 
-static char current_block[37];
+static char current_block[40];
 static char *current_hash;
 static char *current_hash;
 static uint32_t current_block_id;
 static uint32_t current_block_id;
 char *current_fullhash;
 char *current_fullhash;
 static char datestamp[40];
 static char datestamp[40];
 static char blocktime[30];
 static char blocktime[30];
 struct timeval block_timeval;
 struct timeval block_timeval;
-static char best_share[6]="0";
+static char best_share[8] = "0";
 static uint64_t best_diff = 0;
 static uint64_t best_diff = 0;
 
 
 struct block {
 struct block {
-	char hash[37];
+	char hash[40];
 	UT_hash_handle hh;
 	UT_hash_handle hh;
 	int block_no;
 	int block_no;
 };
 };
@@ -2015,7 +2015,7 @@ static void curses_print_status(void)
 			pool->rpc_url, have_longpoll ? "": "out", pool->rpc_user);
 			pool->rpc_url, have_longpoll ? "": "out", pool->rpc_user);
 	}
 	}
 	wclrtoeol(statuswin);
 	wclrtoeol(statuswin);
-	mvwprintw(statuswin, 5, 0, " Block: %s...  Started: %s  Best diff: %s", current_hash, blocktime, best_share);
+	mvwprintw(statuswin, 5, 0, " Block: %s...  Started: %s  Best share: %s   ", current_hash, blocktime, best_share);
 	mvwhline(statuswin, 6, 0, '-', 80);
 	mvwhline(statuswin, 6, 0, '-', 80);
 	mvwhline(statuswin, statusy - 1, 0, '-', 80);
 	mvwhline(statuswin, statusy - 1, 0, '-', 80);
 	mvwprintw(statuswin, devcursor - 1, 1, "[P]ool management %s[S]ettings [D]isplay options [Q]uit",
 	mvwprintw(statuswin, devcursor - 1, 1, "[P]ool management %s[S]ettings [D]isplay options [Q]uit",
@@ -2432,11 +2432,16 @@ static uint64_t share_diff(const struct work *work)
 static uint32_t scrypt_diff(const struct work *work)
 static uint32_t scrypt_diff(const struct work *work)
 {
 {
 	const uint32_t scrypt_diffone = 0x0000fffful;
 	const uint32_t scrypt_diffone = 0x0000fffful;
-	uint32_t d32 = work->outputhash;
+	uint32_t d32 = work->outputhash, ret;
 
 
 	if (unlikely(!d32))
 	if (unlikely(!d32))
 		d32 = 1;
 		d32 = 1;
-	return scrypt_diffone / d32;
+	ret = scrypt_diffone / d32;
+	if (ret > best_diff) {
+		best_diff = ret;
+		suffix_string(best_diff, best_share, 0);
+	}
+	return ret;
 }
 }
 
 
 static bool submit_upstream_work(struct work *work, CURL *curl, bool resubmit)
 static bool submit_upstream_work(struct work *work, CURL *curl, bool resubmit)