[FIX] Potential regression

This commit is contained in:
Sebastian Grewe 2014-02-28 09:18:38 +01:00
parent 892ca5f85f
commit 9969352056
3 changed files with 7 additions and 3 deletions

View File

@ -335,6 +335,7 @@ class Transaction extends Base {
}
private function createDebitRecord($account_id, $coin_address, $amount, $type) {
$type == 'Debit_MP' ? $txfee = $this->config['txfee_manual'] : $txfee = $this->config['txfee_auto'];
$amount = $amount - $txfee;
// Add Debit record
if (!$this->addTransaction($account_id, $amount, $type, NULL, $coin_address, NULL)) {
$this->setErrorMessage('Failed to create ' . $type . ' transaction record in database');
@ -366,7 +367,7 @@ class Transaction extends Base {
// Notify user via mail
$aMailData['email'] = $this->user->getUserEmailById($account_id);
$aMailData['subject'] = $type . ' Completed';
$aMailData['amount'] = $amount - $txfee;
$aMailData['amount'] = $amount;
if (!$this->notification->sendNotification($account_id, 'payout', $aMailData)) {
$this->setErrorMessage('Failed to send notification email to users address: ' . $aMailData['email'] . 'ERROR: ' . $this->notification->getCronError());
}

View File

@ -37,6 +37,9 @@ $dPoolHashrate = $statistics->getCurrentHashrate($interval);
if ($dPoolHashrate > $dNetworkHashrate) $dNetworkHashrate = $dPoolHashrate;
$statistics->setGetCache(true);
// Small helper
$aHashunits = array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s', '0.000000001' => 'TH/s' );
// Apply pool modifiers
$dPoolHashrateAdjusted = $dPoolHashrate * $dPoolHashrateModifier;
$dNetworkHashrateAdjusted = $dNetworkHashrate / 1000 * $dNetworkHashrateModifier;
@ -64,7 +67,7 @@ if ($iEstShares > 0 && $aRoundShares['valid'] > 0) {
$data = array(
'raw' => array( 'workers' => $worker->getCountAllActiveWorkers(), 'pool' => array( 'hashrate' => $dPoolHashrate ) ),
'pool' => array( 'workers' => $worker->getCountAllActiveWorkers(), 'hashrate' => $dPoolHashrateAdjusted, 'estimated' => $iEstShares, 'progress' => $dEstPercent ),
'network' => array( 'hashrate' => $dNetworkHashrateAdjusted, 'difficulty' => $dDifficulty, 'block' => $iBlock ),
'network' => array( 'hashrate' => $dNetworkHashrateAdjusted, 'difficulty' => $dDifficulty, 'block' => $iBlock )
);
echo $api->get_json($data);

View File

@ -2,7 +2,7 @@
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
// ReCaptcha handling if enabled
if ($setting->getValue('recaptcha_enabled') && $setting->getValue('acl_contactform') != 2) {
if ($setting->getValue('recaptcha_enabled') && $setting->getValue('recaptcha_enabled_contactform') && $setting->getValue('acl_contactform') != 2) {
require_once(INCLUDE_DIR . '/lib/recaptchalib.php');
// Load re-captcha specific data
$rsp = recaptcha_check_answer (