From 0999ee54b25a8ad89490219953eb80f8bb11bbc5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 28 Apr 2014 11:12:04 +0200 Subject: [PATCH] =?utf8?q?Removed=20hashesPerBlock=20display=20+=20reduced?= =?utf8?q?=20blocked=20size=20as=20it=20is=20now=20much=20harder=20to=20fi?= =?utf8?q?nd=20a=20good=20hash.=20Signed-off-by:=20Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- contrib/chash/chash.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/contrib/chash/chash.php b/contrib/chash/chash.php index f4003c8a..3ba7e162 100644 --- a/contrib/chash/chash.php +++ b/contrib/chash/chash.php @@ -2,7 +2,7 @@ error_reporting(E_ALL | E_STRICT); define('HASH_ALGO', MHASH_RIPEMD320); -define('BLOCK_SIZE', 1000); +define('BLOCK_SIZE', 100); define('NONCE_INCREMENT', 0.0000000001); define('START_TIME', microtime(TRUE)); @@ -275,7 +275,6 @@ while (TRUE) { // Calculate sums $sumNonce = calculateSumFromHash($nonceHash); - //print('hashesPerBlock=' . $hashesPerBlock . PHP_EOL); // Time spend in loop $testTime = abs(microtime(TRUE) - $timeDisplay); @@ -286,7 +285,7 @@ while (TRUE) { // Only every second if ($testTime >= 1) { // Display hash rate - print ('hashesPerBlock=' . $hashesPerBlock . ',hashrate=' . $hashrate . ' hashes/sec.' . PHP_EOL); + print ('hashrate=' . $hashrate . ' hashes/sec.' . PHP_EOL); // Reset timer $timeDisplay = microtime(TRUE); @@ -302,9 +301,6 @@ while (TRUE) { //print ('sumModula=' . $sumModula . PHP_EOL); } // END - while - // Add amount of hashes to block (double-hash) - $hashesPerBlock += $iter * 2 + 2; - // If the iteration is zero, then no hash is found if ($iter == 0) { // Bad block found @@ -318,8 +314,11 @@ while (TRUE) { continue; } // END - if + // Add amount of hashes to block (double-hash) + $hashesPerBlock += $iter * 2 + 2; + // Found hash: - //print ('nonceHash=' . $nonceHash .',iter=' . $iter . PHP_EOL); + print ('FOUND: nonceHash=' . $nonceHash .',iter=' . $iter . PHP_EOL); // Use nonceHash as next modula hash $modulaHash = $nonceHash; -- 2.39.5