Skip to content

Commit

Permalink
coinexchange: check wallet status and disable if offline
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed Jan 3, 2018
1 parent dfb2822 commit 149e950
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions web/yaamp/core/backend/markets.php
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,17 @@ function updateCoinExchangeMarkets()
continue;
}

if($currency->Active && $coin->enable) {
// check wallet status (deposit/withdrawals)
$status = coinexchange_api_query('getcurrency', 'ticker_code='.$symbol);
if(is_object($status) && is_object($status->result)) {
$res = $status->result;
if($market->disabled < 9) $market->disabled = (objSafeVal($res,'WalletStatus') == "offline");
$market->message = $market->disabled ? $res->WalletStatus : '';
//debuglog("$exchange: $symbol wallet is {$res->WalletStatus}");
}
}

$market->save();

if($market->disabled || $market->deleted) continue;
Expand Down

0 comments on commit 149e950

Please sign in to comment.