Continued with chash:
[core.git] / contrib / chash / chash.php
index e04f03a472c17ff65968f9b9a3a6d0d249b7a186..4dfc6075e2c180dc72857f80840b5c8fc5bf3845 100644 (file)
@@ -283,6 +283,9 @@ while (true) {
                addFoundHash($nonceHash);
        } // END - while
 
+       // Flush check-point file
+       flushCheckPointFile($GLOBALS['current_hash']);
+
        // Time taken for one
        $timeBlock = abs(microtime(true) - $timeBlock);
 
@@ -290,8 +293,8 @@ while (true) {
        $reward = abs($timeBlock - $timeBadHashes) / max(1, $hashRate) * $GLOBALS['hashes_block'] / max(1, $GLOBALS['block_size']) * 1000;
        print('timeBlock=' . $timeBlock . ',timeBadHashes=' . $timeBadHashes . ',hashesPerBlock=' . $GLOBALS['hashes_block'] .',reward=' . $reward . PHP_EOL);
 
-       // Double difficulty
-       $GLOBALS['difficulty'] = $GLOBALS['difficulty'] * 2;
+       // Increase difficulty
+       $GLOBALS['difficulty'] = $GLOBALS['difficulty']++;
 
        // Block completed
        $GLOBALS['total_hashes'] += $GLOBALS['hashes_block'];