mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 17:37:25 +00:00
c11 stratum ok, link first exchanges
This commit is contained in:
parent
ce1457a183
commit
cc925bc5f1
9 changed files with 33 additions and 28 deletions
1
rc.local
1
rc.local
|
@ -15,6 +15,7 @@ screen -dmS main /var/web/main.sh
|
|||
screen -dmS loop2 /var/web/loop2.sh
|
||||
screen -dmS blocks /var/web/blocks.sh
|
||||
|
||||
screen -dmS c11 /var/stratum/run.sh c11
|
||||
screen -dmS x11 /var/stratum/run.sh x11
|
||||
#screen -dmS x13 /var/stratum/run.sh x13
|
||||
#screen -dmS x15 /var/stratum/run.sh x15
|
||||
|
|
|
@ -56,7 +56,7 @@ void zr5_hash(const char* input, char* output, uint32_t len)
|
|||
sph_skein512_context ctx_skein;
|
||||
|
||||
uint32_t hash[5][16];
|
||||
char *ph = (char *)hash;
|
||||
char *ph = (char *)hash[0];
|
||||
|
||||
sph_keccak512_init(&ctx_keccak);
|
||||
sph_keccak512(&ctx_keccak, (const void*) input, len);
|
||||
|
|
|
@ -106,7 +106,7 @@ function AverageIncrement($value1, $value2)
|
|||
function updateBleutradeMarkets()
|
||||
{
|
||||
$list = bleutrade_api_query('public/getcurrencies');
|
||||
if(!$list) return;
|
||||
if(!is_object($list)) return;
|
||||
|
||||
foreach($list->result as $currency)
|
||||
{
|
||||
|
@ -143,7 +143,7 @@ function updateBleutradeMarkets()
|
|||
{
|
||||
$address = bleutrade_api_query('account/getdepositaddress', "¤cy=$coin->symbol");
|
||||
|
||||
if($address && isset($address->result))
|
||||
if(is_object($address) && is_object($address->result))
|
||||
$market->deposit_address = $address->result->Address;
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ function updateBleutradeMarkets()
|
|||
function updateBittrexMarkets()
|
||||
{
|
||||
$list = bittrex_api_query('public/getcurrencies');
|
||||
if(!$list) return;
|
||||
if(!is_object($list)) return;
|
||||
|
||||
foreach($list->result as $currency)
|
||||
{
|
||||
|
@ -207,7 +207,7 @@ function updateBittrexMarkets()
|
|||
{
|
||||
$address = bittrex_api_query('account/getdepositaddress', "¤cy=$coin->symbol");
|
||||
|
||||
if($address && isset($address->result))
|
||||
if(is_object($address) && isset($address->result))
|
||||
$market->deposit_address = $address->result->Address;
|
||||
}
|
||||
|
||||
|
@ -323,6 +323,8 @@ function updateCryptsyMarkets()
|
|||
}
|
||||
|
||||
$list = cryptsy_api_query('getmydepositaddresses');
|
||||
if (empty($list)) return;
|
||||
|
||||
foreach($list['return'] as $symbol=>$item)
|
||||
{
|
||||
// debuglog($item);
|
||||
|
@ -348,6 +350,8 @@ function updateCCexMarkets()
|
|||
$ccex = new CcexAPI;
|
||||
|
||||
$list = $ccex->getPairs();
|
||||
if (!is_array($list)) return;
|
||||
|
||||
foreach($list as $item)
|
||||
{
|
||||
$e = explode('-', $item);
|
||||
|
@ -387,7 +391,7 @@ function updatePoloniexMarkets()
|
|||
$poloniex = new poloniex;
|
||||
|
||||
$tickers = $poloniex->get_ticker();
|
||||
if(!$tickers) return;
|
||||
if(!is_array($tickers)) return;
|
||||
|
||||
foreach($tickers as $symbol=>$ticker)
|
||||
{
|
||||
|
@ -419,6 +423,8 @@ function updatePoloniexMarkets()
|
|||
}
|
||||
|
||||
$list = $poloniex->get_deposit_addresses();
|
||||
if (!is_array($list)) return;
|
||||
|
||||
foreach($list as $symbol=>$item)
|
||||
{
|
||||
if($symbol == 'BTC') continue;
|
||||
|
@ -439,7 +445,7 @@ function updatePoloniexMarkets()
|
|||
function updateYobitMarkets()
|
||||
{
|
||||
$res = yobit_api_query('info');
|
||||
if(!$res) return;
|
||||
if(!is_object($res)) return;
|
||||
|
||||
foreach($res->pairs as $i=>$item)
|
||||
{
|
||||
|
@ -475,7 +481,7 @@ function updateYobitMarkets()
|
|||
function updateJubiMarkets()
|
||||
{
|
||||
$btc = jubi_api_query('ticker', "?coin=btc");
|
||||
if(!$btc) continue;
|
||||
if(!is_object($btc)) continue;
|
||||
|
||||
$list = getdbolist('db_markets', "name='jubi'");
|
||||
foreach($list as $market)
|
||||
|
@ -486,10 +492,12 @@ function updateJubiMarkets()
|
|||
$lowsymbol = strtolower($coin->symbol);
|
||||
|
||||
$ticker = jubi_api_query('ticker', "?coin=$lowsymbol");
|
||||
if(!$ticker) continue;
|
||||
if(!is_object($ticker)) continue;
|
||||
|
||||
$ticker->buy /= $btc->sell;
|
||||
$ticker->sell /= $btc->buy;
|
||||
if (isset($btc->sell) && $btc->sell != 0.)
|
||||
$ticker->buy /= $btc->sell;
|
||||
if (isset($btc->buy) && $btc->buy != 0.)
|
||||
$ticker->sell /= $btc->buy;
|
||||
|
||||
$price2 = ($ticker->buy+$ticker->sell)/2;
|
||||
$market->price2 = AverageIncrement($market->price2, $price2);
|
||||
|
|
|
@ -245,9 +245,3 @@ function BackendRunCoinActions()
|
|||
// system("echo \"$data\" | mail -s \"yiimp server\" ".YAAMP_ADMIN_EMAIL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
class CcexAPI
|
||||
{
|
||||
|
||||
protected $api_url = 'https://c-cex.com/t/';
|
||||
protected $api_key = '';
|
||||
protected $api_secret = ''; // not used?
|
||||
protected $api_url = 'https://c-cex.com/t/';
|
||||
protected $api_key = '9582CED05D859FA83E5E0E22F23E0A7E';
|
||||
protected $api_secret = ''; // not used?
|
||||
|
||||
// public function __construct($api_key = '') {
|
||||
// $this->api_key = $api_key;
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
<?php
|
||||
|
||||
|
||||
function cryptsy_api_query($method, array $req = array())
|
||||
{
|
||||
// debuglog("calling cryptsy_api_query $method");
|
||||
// debuglog($req);
|
||||
|
||||
require_once('/etc/yiimp/keys.php');
|
||||
|
||||
// API settings
|
||||
$key = ''; // your API-key
|
||||
$secret = ''; // your Secret-key
|
||||
$key = '44752827db114b157b19b22ee30b88eba3f40651'; // your API-key
|
||||
$secret = YIIMP_CRYPT_PVK; // your Secret-key
|
||||
|
||||
$req['method'] = $method;
|
||||
$mt = explode(' ', microtime());
|
||||
|
|
|
@ -17,7 +17,11 @@ function doCryptsyTrading($quick=false)
|
|||
// debuglog("-------------- doCryptsyTrading() $flushall");
|
||||
|
||||
$orders = cryptsy_api_query('allmyorders');
|
||||
if(!$orders) return;
|
||||
if(empty($orders)) return;
|
||||
if(!is_array($orders)) {
|
||||
debuglog("-------------- doCryptsyTrading() $flushall $orders");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach($orders['return'] as $order)
|
||||
{
|
||||
|
|
|
@ -6,7 +6,7 @@ class SiteController extends CommonController
|
|||
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
public function actionAdmintest()
|
||||
public function actionAdminRights()
|
||||
{
|
||||
debuglog("admin login {$_SERVER['REMOTE_ADDR']}");
|
||||
|
||||
|
|
|
@ -191,6 +191,3 @@ class CronjobController extends CommonController
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue