From 6b48c43a87c35c0c9a1e8ff2ea43d8ffd3c66d4c Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Fri, 10 Jul 2015 07:53:52 +0200 Subject: [PATCH] markets: only warn about unkown exchange on enabled coins --- web/yaamp/core/backend/markets.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/web/yaamp/core/backend/markets.php b/web/yaamp/core/backend/markets.php index 44168cc..1f5b21d 100644 --- a/web/yaamp/core/backend/markets.php +++ b/web/yaamp/core/backend/markets.php @@ -77,6 +77,15 @@ function BackendPricesUpdate() function getBestMarket($coin) { $market = NULL; + if ($coin->symbol == 'BTC') + return NULL; + + if (!empty($coin->symbol2)) { + $alt = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$coin->symbol2)); + if ($alt) + return getBestMarket($alt); + } + if (!empty($coin->market)) { // get coin market first (if set) if ($coin->market != 'BEST') @@ -101,7 +110,8 @@ function getBestMarket($coin) ORDER BY price DESC"); } - if (!$market) + // note: you can add a record in market to hide this debug warning + if (!$market && $coin->enable) debuglog("best market for {$coin->symbol} is unknown"); //else // debuglog("best market for {$coin->symbol} is {$market->name}");