X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=contrib%2Fchash%2Fchash.php;h=1c4965cb835d56892179bff65dea904f3627a106;hb=e72033bed456c820815feeb2d25335245499448e;hp=41af8db1c97077b765294049e5dbeb811a62e4e2;hpb=95a008a7823f28fa6a1172798e0d7565385055d4;p=core.git diff --git a/contrib/chash/chash.php b/contrib/chash/chash.php index 41af8db1..1c4965cb 100644 --- a/contrib/chash/chash.php +++ b/contrib/chash/chash.php @@ -1,7 +1,7 @@ = $GLOBALS['flush_file_time']) { @@ -484,7 +484,7 @@ while (TRUE) { } // END - if // Time spend from last found block - $testTime = abs(microtime(TRUE) - $GLOBALS['found_time']); + $testTime = abs(microtime(true) - $GLOBALS['found_time']); // Is the last found time to far away? if ($testTime >= $GLOBALS['restart_search_time']) { @@ -501,7 +501,7 @@ while (TRUE) { foreach ($block as $hash) { if (!isset($hash['root_hash'])) { // Bad file - die('INCONSISTENCY: hash=' . print_r($hash, TRUE)); + die('INCONSISTENCY: hash=' . print_r($hash, true)); } // END - if if (isset($rootHashes[$hash['root_hash']])) { @@ -544,7 +544,7 @@ while (TRUE) { print ('idx=' . $idx . ',modulaHash=' . $GLOBALS['root_hash'] . ' - Is now new root hash!' . PHP_EOL); // Reset "found time" (when a hash was found) - $GLOBALS['found_time'] = microtime(TRUE); + $GLOBALS['found_time'] = microtime(true); // Re-initialize nonce initNonce(); @@ -568,7 +568,7 @@ while (TRUE) { // If the iteration is zero, then no hash is found if ($GLOBALS['iteration'] == 0) { // Bad hash found - $timeBadHashes += abs(microtime(TRUE) - $timeHash); + $timeBadHashes += abs(microtime(true) - $timeHash); // And next round print('BAD:nonce=' . $GLOBALS['nonce'] . PHP_EOL); @@ -586,7 +586,7 @@ while (TRUE) { } // END - while // Time taken for one - $timeBlock = abs(microtime(TRUE) - $timeBlock); + $timeBlock = abs(microtime(true) - $timeBlock); // Calculate reward $reward = abs($timeBlock - $timeBadHashes) / $hashrate * $GLOBALS['hashes_block'] / $GLOBALS['block_size'] * 1000; @@ -610,7 +610,7 @@ while (TRUE) { $blockValue = $GLOBALS['total_reward'] / $GLOBALS['total_blocks'] * $GLOBALS['total_hashes'] / ($GLOBALS['block_size'] * $GLOBALS['total_blocks']); // Calculate reward per hour (= 3600 seconds) - $rewardPerHour = $GLOBALS['total_reward'] / abs(microtime(TRUE) - START_TIME) * 3600; + $rewardPerHour = $GLOBALS['total_reward'] / abs(microtime(true) - START_TIME) * 3600; print ('totalReward=' . $GLOBALS['total_reward'] . ',blockValue=' . $blockValue . ',rewardPerHour=' . $rewardPerHour . PHP_EOL); } // END - while