From c28400a92eed1757052d0b56b1e22a6b9d63bd54 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Tue, 16 Feb 2016 05:30:10 +0100 Subject: [PATCH] payouts: use a new config variable for the minimum --- web/serverconfig.sample.php | 1 + web/yaamp/core/backend/payment.php | 14 +++++++------- web/yaamp/defaultconfig.php | 1 + web/yaamp/modules/site/index.php | 5 ++++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/web/serverconfig.sample.php b/web/serverconfig.sample.php index 9629386..2edaf41 100644 --- a/web/serverconfig.sample.php +++ b/web/serverconfig.sample.php @@ -19,6 +19,7 @@ define('YAAMP_FEES_MINING', 0.5); define('YAAMP_FEES_EXCHANGE', 2); define('YAAMP_FEES_RENTING', 2); define('YAAMP_PAYMENTS_FREQ', 3*60*60); +define('YAAMP_PAYMENTS_MINI', 0.001); define('YAAMP_ALLOW_EXCHANGE', false); define('YIIMP_PUBLIC_EXPLORER', true); diff --git a/web/yaamp/core/backend/payment.php b/web/yaamp/core/backend/payment.php index 684dd21..20c4d9c 100644 --- a/web/yaamp/core/backend/payment.php +++ b/web/yaamp/core/backend/payment.php @@ -22,12 +22,12 @@ function BackendCoinPayments($coin) } $txfee = floatval($coin->txfee); - $min = max(0.001, $txfee); + $min_payout = max(floatval(YAAMP_PAYMENTS_MINI), $txfee); -// if(date("w", time()) == 0 && date("H", time()) > 12) // sunday afternoon -// $min = 0.0001; + if(date("w", time()) == 0 && date("H", time()) > 18) // sunday evening, minimum reduced + $min_payout = max($min_payout/10, $txfee); - $users = getdbolist('db_accounts', "balance>$min and coinid=$coin->id"); + $users = getdbolist('db_accounts', "balance>$min_payout and coinid={$coin->id}"); // todo: db field if($coin->symbol == 'MUE' || $coin->symbol == 'BOD' || $coin->symbol == 'DIME' || $coin->symbol == 'BTCRY') @@ -38,7 +38,7 @@ function BackendCoinPayments($coin) if(!$user) continue; $amount = $user->balance; - while($user->balance > $min && $amount > $min) + while($user->balance > $min_payout && $amount > $min_payout) { debuglog("$coin->symbol sendtoaddress $user->username $amount"); $tx = $remote->sendtoaddress($user->username, round($amount, 8)); @@ -119,7 +119,7 @@ function BackendCoinPayments($coin) foreach($cold_wallet_table as $coldwallet=>$percent) { $coldamount = round($pie * $percent, 8); - if($coldamount < $min) break; + if($coldamount < $min_payout) break; debuglog("paying cold wallet $coldwallet $coldamount"); @@ -208,7 +208,7 @@ function BackendCoinPayments($coin) $payout->time = time(); $payout->amount = $amount_failed; $payout->fee = 0; - if ($payout->save() && $amount_failed > $txfee) { + if ($payout->save() && $amount_failed > $min_payout) { $payouts[$payout->id] = $user->id; $addresses[$user->username] = $amount_failed; $mailmsg .= "{$amount_failed} {$coin->symbol} to {$user->username} - user id {$user->id}\n"; diff --git a/web/yaamp/defaultconfig.php b/web/yaamp/defaultconfig.php index 704973a..a129fa3 100644 --- a/web/yaamp/defaultconfig.php +++ b/web/yaamp/defaultconfig.php @@ -17,6 +17,7 @@ if (!defined('YAAMP_FEES_MINING')) define('YAAMP_FEES_MINING', 0.5); if (!defined('YAAMP_FEES_EXCHANGE')) define('YAAMP_FEES_EXCHANGE', 2); if (!defined('YAAMP_FEES_RENTING')) define('YAAMP_FEES_RENTING', 2); if (!defined('YAAMP_PAYMENTS_FREQ')) define('YAAMP_PAYMENTS_FREQ', 24*60*60); +if (!defined('YAAMP_PAYMENTS_MINI')) define('YAAMP_PAYMENTS_MINI', 0.001); if (!defined('YAAMP_ALLOW_EXCHANGE')) define('YAAMP_ALLOW_EXCHANGE', false); if (!defined('EXCH_AUTO_WITHDRAW')) define('EXCH_AUTO_WITHDRAW', 9999.9999); diff --git a/web/yaamp/modules/site/index.php b/web/yaamp/modules/site/index.php index d5e191d..d370573 100644 --- a/web/yaamp/modules/site/index.php +++ b/web/yaamp/modules/site/index.php @@ -11,6 +11,9 @@ JavascriptFile('/yaamp/ui/js/auto_refresh.js'); $height = '240px'; +$min_payout = floatval(YAAMP_PAYMENTS_MINI); +$min_sunday = $min_payout/10; + ?>
This fork based on the Yaamp published source code will be soon another open source project.
  • No registration is required, we do payouts in the currency you mine. Use your wallet address as the username.
  •  
  • -
  • Payouts are made automatically every 2H for all balances above 0.001, or 0.0001 on Sunday.
  • +
  • Payouts are made automatically every 2H for all balances above , or on Sunday.
  • For some coins, there is an initial delay before the first payout, please wait at least 6 hours before asking for support.
  • Blocks are distributed proportionally among valid submitted shares.