// Next round
$GLOBALS['iteration']++;
$GLOBALS['iteration_second']++;
- //print ('nonce=' . $GLOBALS['nonce'] . ',iteration=' . $GLOBALS['iteration'] . PHP_EOL);
- //print ('nonceHash=' . $nonceHash . PHP_EOL);
- //print ('sumNonce=' . $sumNonce . PHP_EOL);
- //print ('sumGenesis=' . $GLOBALS['sum_genesis'] . PHP_EOL);
+ //* NOISY-DEBUG: */ print('nonce=' . $GLOBALS['nonce'] . ',iteration=' . $GLOBALS['iteration'] . PHP_EOL);
+ //* NOISY-DEBUG: */ print('nonceHash=' . $nonceHash . PHP_EOL);
+ //* NOISY-DEBUG: */ print('sumNonce=' . $sumNonce . PHP_EOL);
+ //* NOISY-DEBUG: */ print('sumGenesis=' . $GLOBALS['sum_genesis'] . PHP_EOL);
} // END - while
// If the iteration is zero, then no hash is found
$timeBadHashes += abs(microtime(true) - $timeHash);
// And next round
- print('BAD:nonce=' . $GLOBALS['nonce'] . PHP_EOL);
+ //* NOISY-DEBUG: */ print('BAD:nonce=' . $GLOBALS['nonce'] . PHP_EOL);
// Nothing found, so calculate new nonce
calculateNonce();
$timeBlock = abs(microtime(true) - $timeBlock);
// Calculate reward
- $reward = abs($timeBlock - $timeBadHashes) / $hashRate * $GLOBALS['hashes_block'] / max(1, $GLOBALS['block_size']) * 1000;
+ $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