Commit af15955b784cd1b43084a5ec04c989bd02bb4962

Con Kolivas 2011-08-29T15:25:14

Exit with a failed return code if we did not reach opt_shares.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/main.c b/main.c
index 897aca2..6f45dc6 100644
--- a/main.c
+++ b/main.c
@@ -4311,6 +4311,8 @@ static void print_summary(void)
 		applog(LOG_WARNING, "Mined %d accepted shares of %d requested\n", total_accepted, opt_shares);
 	fflush(stdout);
 	fflush(stderr);
+	if (opt_shares > total_accepted)
+		quit(1, "Did not successfully mine as many shares as were requested.");
 }
 
 void quit(int status, const char *format, ...)