Look for autovoltage returning to zero on cta driver and reset stats at that point since the hashrate is unreliable till then.
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
diff --git a/driver-cointerra.c b/driver-cointerra.c
index 0d9a36c..31a339a 100644
--- a/driver-cointerra.c
+++ b/driver-cointerra.c
@@ -555,6 +555,8 @@ static void cta_parse_rdone(struct cgpu_info *cointerra, struct cointerra_info *
}
}
+static void cta_zero_stats(struct cgpu_info *cointerra);
+
static void cta_parse_debug(struct cointerra_info *info, char *buf)
{
mutex_lock(&info->lock);
@@ -573,6 +575,15 @@ static void cta_parse_debug(struct cointerra_info *info, char *buf)
info->power_temps[1] = hu16_from_msg(buf,CTA_STAT_PS_TEMP2);
mutex_unlock(&info->lock);
+
+ /* Autovoltage is positive only once at startup and eventually drops
+ * to zero. After that time we reset the stats since they're unreliable
+ * till then. */
+ if (unlikely(!info->autovoltage_complete && !info->autovoltage)) {
+ info->autovoltage_complete = true;
+ cgtime(&info->thr->cgpu->dev_start_tv);
+ cta_zero_stats(info->thr->cgpu);
+ }
}
static void cta_parse_msg(struct thr_info *thr, struct cgpu_info *cointerra,
diff --git a/driver-cointerra.h b/driver-cointerra.h
index d8344e8..66e315e 100644
--- a/driver-cointerra.h
+++ b/driver-cointerra.h
@@ -194,6 +194,7 @@ struct cointerra_info {
uint16_t ipower_voltage;
uint16_t power_temps[2];
+ bool autovoltage_complete;
/* Calculated totals based on work done and nonces found */
uint64_t hashes;