From e2d8fa818ab77641028d5afbab14deaeb5007a17 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Wed, 28 Jun 2017 14:51:02 +0200 Subject: [PATCH] renting: add a server constant for withdraw tx fees --- web/serverconfig.sample.php | 1 + web/yaamp/core/backend/renting.php | 2 +- web/yaamp/defaultconfig.php | 1 + web/yaamp/modules/renting/RentingController.php | 6 +++--- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/web/serverconfig.sample.php b/web/serverconfig.sample.php index a7e2ba3..f050aa5 100644 --- a/web/serverconfig.sample.php +++ b/web/serverconfig.sample.php @@ -18,6 +18,7 @@ define('YAAMP_LIMIT_ESTIMATE', false); define('YAAMP_FEES_MINING', 0.5); define('YAAMP_FEES_EXCHANGE', 2); define('YAAMP_FEES_RENTING', 2); +define('YAAMP_TXFEE_RENTING_WD', 0.002); define('YAAMP_PAYMENTS_FREQ', 3*60*60); define('YAAMP_PAYMENTS_MINI', 0.001); diff --git a/web/yaamp/core/backend/renting.php b/web/yaamp/core/backend/renting.php index 57d3645..a17ea01 100644 --- a/web/yaamp/core/backend/renting.php +++ b/web/yaamp/core/backend/renting.php @@ -226,7 +226,7 @@ function BackendUpdateDeposit() ///////////////////////////////////////////////////////////////////////////////////////////////////// - $fees = 0.0001; + $fees = YAAMP_TXFEE_RENTING_WD; // 0.002 $list = getdbolist('db_rentertxs', "type='withdraw' and tx='scheduled'"); foreach($list as $tx) diff --git a/web/yaamp/defaultconfig.php b/web/yaamp/defaultconfig.php index f0be97c..5dc5cd1 100644 --- a/web/yaamp/defaultconfig.php +++ b/web/yaamp/defaultconfig.php @@ -19,6 +19,7 @@ if (!defined('YIIMP_KWH_USD_PRICE')) define('YIIMP_KWH_USD_PRICE', 0.25); 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_TXFEE_RENTING_WD')) define('YAAMP_TXFEE_RENTING_WD', 0.002); if (!defined('YAAMP_PAYMENTS_FREQ')) define('YAAMP_PAYMENTS_FREQ', 24*60*60); if (!defined('YAAMP_PAYMENTS_MINI')) define('YAAMP_PAYMENTS_MINI', 0.001); diff --git a/web/yaamp/modules/renting/RentingController.php b/web/yaamp/modules/renting/RentingController.php index ecc6a01..53a4f41 100644 --- a/web/yaamp/modules/renting/RentingController.php +++ b/web/yaamp/modules/renting/RentingController.php @@ -410,7 +410,7 @@ end; public function actionWithdraw() { - $fees = 0.0001; + $fees = YAAMP_TXFEE_RENTING_WD; // 0.002 $deposit = user()->getState('yaamp-deposit'); if(!$deposit) @@ -430,9 +430,9 @@ end; $address = getparam('withdraw_address'); $amount = floatval(bitcoinvaluetoa(min($amount, $renter->balance-$fees))); - if($amount < 0.001) + if($amount < YAAMP_PAYMENTS_MINI) // 0.001 { - user()->setFlash('error', 'Minimum withdraw is 0.001'); + user()->setFlash('error', 'Minimum withdraw is '.YAAMP_PAYMENTS_MINI); $this->redirect("/renting"); return; }