From 0fc5e5965332152cf7d39308f4ede3b6613d0c66 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Mon, 6 Jul 2015 01:10:43 +0200 Subject: [PATCH] markets: comment traces --- rc.local | 5 +++-- web/yaamp/core/backend/markets.php | 26 +++++++++++++++++------ web/yaamp/core/exchange/exchange.php | 1 + web/yaamp/modules/site/SiteController.php | 9 ++++---- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/rc.local b/rc.local index 4139fe0..9781e6c 100644 --- a/rc.local +++ b/rc.local @@ -20,11 +20,12 @@ screen -dmS x11 /var/stratum/run.sh x11 #screen -dmS x13 /var/stratum/run.sh x13 #screen -dmS x15 /var/stratum/run.sh x15 screen -dmS sha /var/stratum/run.sh sha -#screen -dmS scrypt1 /var/stratum/run.sh scrypt +screen -dmS scrypt /var/stratum/run.sh scrypt #screen -dmS scrypt2 /var/stratum/run.sh scryptn screen -dmS neo /var/stratum/run.sh neo screen -dmS quark /var/stratum/run.sh quark -#screen -dmS qubit /var/stratum/run.sh qubit +screen -dmS qubit /var/stratum/run.sh qubit +#screen -dmS groestl /var/stratum/run.sh groestl # dmd-gr -m 256 screen -dmS lyra2 /var/stratum/run.sh lyra2 screen -dmS skein /var/stratum/run.sh skein diff --git a/web/yaamp/core/backend/markets.php b/web/yaamp/core/backend/markets.php index cd61801..10fe81d 100644 --- a/web/yaamp/core/backend/markets.php +++ b/web/yaamp/core/backend/markets.php @@ -112,7 +112,7 @@ function updateBleutradeMarkets() foreach($list->result as $currency) { - // debuglog($currency); + // debuglog($currency); if($currency->Currency == 'BTC') continue; $coin = getdbosql('db_coins', "symbol='$currency->Currency'"); @@ -154,6 +154,8 @@ function updateBleutradeMarkets() $market->price = AverageIncrement($market->price, $ticker->result[0]->Bid); $market->save(); + +// debuglog("bleutrade update $coin->symbol: $market->price $market->price2"); } } @@ -218,6 +220,8 @@ function updateBittrexMarkets() $market->price = AverageIncrement($market->price, $ticker->result->Bid); $market->save(); + +// debuglog("bittrex update $coin->symbol: $market->price $market->price2"); } } @@ -299,11 +303,9 @@ function updateCryptsyMarkets() $market->save(); - if($currency['maintenancemode']) - { + if($currency['maintenancemode']) { $market->price = 0; $market->save(); - continue; } @@ -322,6 +324,8 @@ function updateCryptsyMarkets() $market->price = AverageIncrement($market->price, $ticker->return->$symbol->buyorders[0]->price); $market->save(); + +// debuglog("cryptsy update $coin->symbol: $market->price $market->price2"); } $list = cryptsy_api_query('getmydepositaddresses'); @@ -348,7 +352,7 @@ function updateCryptsyMarkets() function updateCCexMarkets() { - // dborun("update markets set price=0 where name='c-cex'"); <- add that line +// dborun("update markets set price=0 where name='c-cex'"); <- add that line $ccex = new CcexAPI; $list = $ccex->getPairs(); @@ -383,6 +387,8 @@ function updateCCexMarkets() $market->price = AverageIncrement($market->price, $ticker['buy']); $market->save(); + +// debuglog("ccex update $coin->symbol: $market->price $market->price2"); } } @@ -422,6 +428,8 @@ function updatePoloniexMarkets() $market->price = AverageIncrement($market->price, $ticker['highestBid']); $market->save(); + +// debuglog("poloniex update $coin->symbol: $market->price $market->price2"); } $list = $poloniex->get_deposit_addresses(); @@ -476,6 +484,8 @@ function updateYobitMarkets() $market->price2 = AverageIncrement($market->price2, $price2); $market->price = AverageIncrement($market->price, $ticker->$pair->buy); +// debuglog("yobit update $coin->symbol: $market->price $market->price2"); + $market->save(); } } @@ -505,6 +515,8 @@ function updateJubiMarkets() $market->price2 = AverageIncrement($market->price2, $price2); $market->price = AverageIncrement($market->price, $ticker->buy*0.95); +// debuglog("jubi update $coin->symbol: $market->price $market->price2"); + $market->save(); } } @@ -541,7 +553,7 @@ function updateAlcurexMarkets() $coin->price2 = $market->price2; $coin->save(); } - debuglog("alcurex... Updated $coin->symbol: $market->price $market->price2"); +// debuglog("alcurex update $coin->symbol: $market->price $market->price2"); } } } @@ -566,13 +578,13 @@ function updateCryptopiaMarkets() $price2 = ($ticker->BidPrice+$ticker->AskPrice)/2; $market->price2 = AverageIncrement($market->price2, $price2); $market->price = AverageIncrement($market->price, $ticker->BidPrice*0.98); - // debuglog("Updated $pair: $market->price"); $market->save(); if (empty($coin->price)) { $coin->price = $market->price; $coin->price2 = $market->price2; $coin->save(); } +// debuglog("cryptopia update $coin->symbol: $market->price $market->price2"); break; } } diff --git a/web/yaamp/core/exchange/exchange.php b/web/yaamp/core/exchange/exchange.php index 743c3a9..df88823 100644 --- a/web/yaamp/core/exchange/exchange.php +++ b/web/yaamp/core/exchange/exchange.php @@ -9,3 +9,4 @@ require_once("yobit.php"); require_once("jubi.php"); require_once("alcurex.php"); require_once("cryptopia.php"); + diff --git a/web/yaamp/modules/site/SiteController.php b/web/yaamp/modules/site/SiteController.php index 9095937..bf2762c 100644 --- a/web/yaamp/modules/site/SiteController.php +++ b/web/yaamp/modules/site/SiteController.php @@ -748,9 +748,9 @@ class SiteController extends CommonController { if(!$this->admin) return; -// $param = getparam('param'); -// if($param) eval($param); -// else $param = ''; +// $param = getparam('param'); +// if($param) eval($param); +// else $param = ''; // $this->render('eval', array('param'=>$param)); } @@ -763,7 +763,8 @@ class SiteController extends CommonController public function actionTest() { - // if(!$this->admin) return; + if(!$this->admin) return; + debuglog("action test"); $ticker = jubi_api_query('ticker', "?coin=sak");