mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-21 02:19:47 +00:00
cryptsy: try catch on ticker and use new pubapi servers
This commit is contained in:
parent
cda26ad1ab
commit
0028095d0b
1 changed files with 12 additions and 3 deletions
|
@ -2,10 +2,19 @@
|
|||
|
||||
function getCryptsyTicker($marketid)
|
||||
{
|
||||
$res = fetch_url("http://pubapi.cryptsy.com/api.php?method=singleorderdata&marketid=$marketid");
|
||||
if(!$res) return null;
|
||||
try {
|
||||
$res = @ fetch_url("http://pubapi2.cryptsy.com/api.php?method=singleorderdata&marketid=$marketid");
|
||||
if(!$res)
|
||||
$res = @ fetch_url("http://pubapi1.cryptsy.com/api.php?method=singleorderdata&marketid=$marketid");
|
||||
if(!$res) return null;
|
||||
|
||||
$ticker = json_decode($res);
|
||||
|
||||
} catch (Exception $e) {
|
||||
debuglog("cryptsy ticker http failure");
|
||||
$ticker = null;
|
||||
}
|
||||
|
||||
$ticker = json_decode($res);
|
||||
return $ticker;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue