backend: disable coinexchange by default

detected an attempt to hack prices this night and dont have private apis
This commit is contained in:
Tanguy Pruvot 2017-04-08 06:20:13 +02:00
parent 10d72b8c22
commit fd780ed27b
3 changed files with 8 additions and 2 deletions

View file

@ -20,6 +20,8 @@ function string_to_hashrate($s)
function BackendCoinsUpdate()
{
$debug = false;
// debuglog(__FUNCTION__);
$t1 = microtime(true);
@ -48,6 +50,8 @@ function BackendCoinsUpdate()
continue;
}
if ($debug) echo "{$coin->symbol}\n";
// debuglog($info);
$coin->enable = true;
@ -221,7 +225,7 @@ function BackendCoinsUpdate()
if($coin->block_height != $info['blocks'])
{
$count = $info['blocks'] - $coin->block_height;
$ttf = (time() - $coin->last_network_found) / $count;
$ttf = $count > 0 ? (time() - $coin->last_network_found) / $count : 0;
if(empty($coin->actual_ttf)) $coin->actual_ttf = $ttf;
@ -241,7 +245,7 @@ function BackendCoinsUpdate()
$coin->save();
if ($coin->available < 0) {
if ($coin->available < 0 || $coin->cleared > $coin->balance) {
// can happen after a payout (waiting first confirmation)
BackendUpdatePoolBalances($coin->id);
}

View file

@ -1125,6 +1125,7 @@ function updateCoinExchangeMarkets()
$market->price = AverageIncrement($market->price, (double) $m->BidPrice);
$market->pricetime = time();
$market->marketid = $exchid;
$market->priority = -1; // not ready for trading
$market->save();
//debuglog("$exchange: $symbol price set to ".bitcoinvaluetoa($market->price));
if (empty($coin->price2)) {

View file

@ -5,6 +5,7 @@ function updateRawcoins()
// debuglog(__FUNCTION__);
exchange_set_default('empoex', 'disabled', true);
exchange_set_default('coinexchange', 'disabled', true);
settings_prefetch_all();