minor cleanup

This commit is contained in:
Sebastian Grewe 2013-08-22 11:27:09 +02:00
parent 56cfa24eb4
commit 2aad605cf2

View File

@ -42,12 +42,6 @@ if ( $bitcoin->can_connect() === true ){
exit(1);
}
// Value per share calculation
// We need to use this instead when running VARDIFF
// $pps_value = number_format(round((1/(65536 * $dDifficulty) * $config['reward']), 12) ,12);
// pps base payout target, default 16 = difficulty 1 shares for vardiff
// (1/(65536 * difficulty) * reward) = (reward / (pow(2,32) * difficulty) * pow(2, 16))
// We support some dynamic reward targets but fall back to our fixed value
// Re-calculate after each run due to re-targets in this loop
if ($config['pps']['reward']['type'] == 'blockavg' && $block->getBlockCount() > 0) {
@ -59,8 +53,8 @@ if ($config['pps']['reward']['type'] == 'blockavg' && $block->getBlockCount() >
$pps_reward = $aLastBlock['amount'];
$log->logInfo("PPS reward using last block, amount: " . $pps_reward . "\tdifficulty: " . $dDifficulty);
} else {
$pps_reward = $config['pps']['reward']['default'];
$log->logInfo("PPS reward using default, amount: " . $pps_reward . "\tdifficulty: " . $dDifficulty);
$pps_reward = $config['pps']['reward']['default'];
$log->logInfo("PPS reward using default, amount: " . $pps_reward . "\tdifficulty: " . $dDifficulty);
}
} else {
$pps_reward = $config['pps']['reward']['default'];
@ -68,8 +62,8 @@ if ($config['pps']['reward']['type'] == 'blockavg' && $block->getBlockCount() >
}
}
// Per-share value to be paid out to users
$pps_value = round($pps_reward / (pow(2,32) * $dDifficulty) * pow(2, $config['pps_target']), 12);
//$pps_value = number_format(round((1/(65536 * $dDifficulty) * $pps_reward), 12) ,12);
// Find our last share accounted and last inserted share for PPS calculations
$iPreviousShareId = $setting->getValue('pps_last_share_id');
@ -121,9 +115,7 @@ $setting->setValue('pps_last_share_id', $iLastShareId);
// Fetch all unaccounted blocks
$aAllBlocks = $block->getAllUnaccounted('ASC');
if (empty($aAllBlocks)) {
$log->logDebug("No new unaccounted blocks found");
}
if (empty($aAllBlocks)) $log->logDebug("No new unaccounted blocks found");
// Go through blocks and archive/delete shares that have been accounted for
foreach ($aAllBlocks as $iIndex => $aBlock) {