Commit 51eb1b4ef9f71f018e83ed69ca04fb37d0c0626b

Jeff Garzik 2011-02-04T11:53:51

Move verbose proof-of-work/target comparison display into -D (debug)

diff --git a/util.c b/util.c
index e37c0a0..25d6d08 100644
--- a/util.c
+++ b/util.c
@@ -283,17 +283,19 @@ bool fulltest(const unsigned char *hash, const unsigned char *target)
 		}
 	}
 
-	hash_str = bin2hex(hash_swap, 32);
-	target_str = bin2hex(target_swap, 32);
-
-	fprintf(stderr, " Proof: %s\nTarget: %s\nTrgVal? %s\n",
-		hash_str,
-		target_str,
-		rc ? "YES (hash < target)" :
-		     "no (false positive; hash > target)");
-
-	free(hash_str);
-	free(target_str);
+	if (opt_debug) {
+		hash_str = bin2hex(hash_swap, 32);
+		target_str = bin2hex(target_swap, 32);
+
+		fprintf(stderr, " Proof: %s\nTarget: %s\nTrgVal? %s\n",
+			hash_str,
+			target_str,
+			rc ? "YES (hash < target)" :
+			     "no (false positive; hash > target)");
+
+		free(hash_str);
+		free(target_str);
+	}
 
 	return rc;
 }