Browse Source

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

Jeff Garzik 15 years ago
parent
commit
51eb1b4ef9
1 changed files with 13 additions and 11 deletions
  1. 13 11
      util.c

+ 13 - 11
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;
 }