Removed hashesPerBlock display + reduced blocked size as it is now much harder to...
authorRoland Häder <haeder@hmmdeutschland.de>
Mon, 28 Apr 2014 09:12:04 +0000 (11:12 +0200)
committerRoland Häder <haeder@hmmdeutschland.de>
Mon, 28 Apr 2014 09:12:04 +0000 (11:12 +0200)
Signed-off-by: Roland Häder <haeder@hmmdeutschland.de>
contrib/chash/chash.php

index f4003c8a60087bc8234c44508a8d4d8a55259170..3ba7e162290e11879bf8d1f4101f50b15303f031 100644 (file)
@@ -2,7 +2,7 @@
 error_reporting(E_ALL | E_STRICT);
 
 define('HASH_ALGO', MHASH_RIPEMD320);
 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));
 
 define('NONCE_INCREMENT', 0.0000000001);
 define('START_TIME', microtime(TRUE));
 
@@ -275,7 +275,6 @@ while (TRUE) {
 
                        // Calculate sums
                        $sumNonce  = calculateSumFromHash($nonceHash);
 
                        // Calculate sums
                        $sumNonce  = calculateSumFromHash($nonceHash);
-                       //print('hashesPerBlock=' . $hashesPerBlock . PHP_EOL);
 
                        // Time spend in loop
                        $testTime = abs(microtime(TRUE) - $timeDisplay);
 
                        // Time spend in loop
                        $testTime = abs(microtime(TRUE) - $timeDisplay);
@@ -286,7 +285,7 @@ while (TRUE) {
                        // Only every second
                        if ($testTime >= 1) {
                                // Display hash rate
                        // 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);
 
                                // Reset timer
                                $timeDisplay = microtime(TRUE);
@@ -302,9 +301,6 @@ while (TRUE) {
                        //print ('sumModula=' . $sumModula . PHP_EOL);
                } // END - while
 
                        //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
                // 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
 
                        continue;
                } // END - if
 
+               // Add amount of hashes to block (double-hash)
+               $hashesPerBlock += $iter * 2 + 2;
+
                // Found hash:
                // 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;
 
                // Use nonceHash as next modula hash
                $modulaHash = $nonceHash;