mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-10-03 18:09:24 +02:00
fix Best Difficulty can not be > 4.29G (#155)
* fix best_nonce_diff, uint32_t is too small * best_nonce_diff as uint64_t
This commit is contained in:
@@ -269,10 +269,10 @@ static double _calculate_network_difficulty(uint32_t nBits)
|
||||
|
||||
static void _check_for_best_diff(SystemModule * module, double diff, uint32_t nbits)
|
||||
{
|
||||
if (diff <= module->best_nonce_diff) {
|
||||
if ((uint64_t) diff <= module->best_nonce_diff) {
|
||||
return;
|
||||
}
|
||||
module->best_nonce_diff = diff;
|
||||
module->best_nonce_diff = (uint64_t) diff;
|
||||
|
||||
nvs_config_set_u64(NVS_CONFIG_BEST_DIFF, module->best_nonce_diff);
|
||||
|
||||
|
@@ -21,7 +21,7 @@ typedef struct
|
||||
uint16_t shares_rejected;
|
||||
int screen_page;
|
||||
char oled_buf[20];
|
||||
uint32_t best_nonce_diff;
|
||||
uint64_t best_nonce_diff;
|
||||
char best_diff_string[DIFF_STRING_SIZE];
|
||||
bool FOUND_BLOCK;
|
||||
bool startup_done;
|
||||
|
Reference in New Issue
Block a user