Commit 6385e68dacb7791106eaf2ca2e3b8b1ce9b3338d

ckolivas 2014-03-26T07:19:47

Put sanity check on decay_time to prevent updates with no time

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/cgminer.c b/cgminer.c
index 6dd2226..bd27071 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2424,6 +2424,8 @@ void decay_time(double *f, double fadd, double fsecs, double interval)
 {
 	double ftotal, fprop;
 
+	if (fsecs <= 0)
+		return;
 	fprop = 1.0 - 1 / (exp(fsecs / interval));
 	ftotal = 1.0 + fprop;
 	*f += (fadd / fsecs * fprop);