From 908031d086016aa926cf899681c9228152528d63 Mon Sep 17 00:00:00 2001 From: crackfoo Date: Thu, 17 Dec 2015 16:04:32 -0400 Subject: [PATCH] Update services.php Rejected speed no longer in API. fixed check to enable Nicehash features, and order location to 0 (Nicehash) --- web/yaamp/core/backend/services.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/web/yaamp/core/backend/services.php b/web/yaamp/core/backend/services.php index bed8bf6..86a16dd 100644 --- a/web/yaamp/core/backend/services.php +++ b/web/yaamp/core/backend/services.php @@ -74,7 +74,6 @@ function BackendUpdateServices() $renter->custom_balance += $stat->balance; $renter->custom_accept += $stat->accepted_speed*1000000000; - $renter->custom_reject += $stat->rejected_speed*1000000000; } $renter->save(); @@ -83,8 +82,8 @@ function BackendUpdateServices() /////////////////////////////////////////////////////////////////////////// // renting from nicehash - if(!YAAMP_PRODUCTION) return; -return; + if (YAAMP_USE_NICEHASH_API != true) + return; $apikey = NICEHASH_API_KEY; $apiid = NICEHASH_API_ID; @@ -112,7 +111,7 @@ return; { if($nicehash->orderid) { - $res = fetch_url("https://www.nicehash.com/api?method=orders.remove&id=$apiid&key=$apikey&algo=$i&order=$nicehash->orderid"); + $res = fetch_url("https://www.nicehash.com/api?method=orders.remove&id=$apiid&key=$apikey&location=0&algo=$i&order=$nicehash->orderid"); debuglog($res); $nicehash->orderid = null; @@ -133,7 +132,7 @@ return; $maxprice = $price*0.9; $cancelprice = $price*1.1; - $res = fetch_url("https://www.nicehash.com/api?method=orders.get&my&id=$apiid&key=$apikey&algo=$i"); + $res = fetch_url("https://www.nicehash.com/api?method=orders.get&my&id=$apiid&key=$apikey&location=0&algo=$i"); if(!$res) break; $a = json_decode($res); @@ -142,7 +141,7 @@ return; if($balance < $amount) continue; $port = getAlgoPort($algo); - $res = fetch_url("https://www.nicehash.com/api?method=orders.create&id=$apiid&key=$apikey&algo=$i&amount=$amount&price=$setprice&limit=0&pool_host=yaamp.com&pool_port=$port&pool_user=$deposit&pool_pass=xx"); + $res = fetch_url("https://www.nicehash.com/api?method=orders.create&id=$apiid&key=$apikey&location=0&algo=$i&amount=$amount&price=$setprice&limit=0&pool_host=yaamp.com&pool_port=$port&pool_user=$deposit&pool_pass=xx"); debuglog($res); $nicehash->last_decrease = time(); @@ -160,13 +159,12 @@ return; $nicehash->price = $order->price; $nicehash->speed = $order->limit_speed; $nicehash->accepted = $order->accepted_speed; - $nicehash->rejected = $order->rejected_speed; if($order->price > $cancelprice && $order->workers > 0) { debuglog("* cancel order $algo"); - $res = fetch_url("https://www.nicehash.com/api?method=orders.remove&id=$apiid&key=$apikey&algo=$i&order=$order->id"); + $res = fetch_url("https://www.nicehash.com/api?method=orders.remove&id=$apiid&key=$apikey&location=0&algo=$i&order=$order->id"); debuglog($res); } @@ -174,7 +172,7 @@ return; { debuglog("* decrease speed $algo"); - $res = fetch_url("https://www.nicehash.com/api?method=orders.set.limit&id=$apiid&key=$apikey&algo=$i&order=$order->id&limit=0.05"); + $res = fetch_url("https://www.nicehash.com/api?method=orders.set.limit&id=$apiid&key=$apikey&location=0&algo=$i&order=$order->id&limit=0.05"); debuglog($res); } @@ -182,7 +180,7 @@ return; { debuglog("* decrease price $algo"); - $res = fetch_url("https://www.nicehash.com/api?method=orders.set.price.decrease&id=$apiid&key=$apikey&algo=$i&order=$order->id"); + $res = fetch_url("https://www.nicehash.com/api?method=orders.set.price.decrease&id=$apiid&key=$apikey&location=0&algo=$i&order=$order->id"); debuglog($res); $nicehash->last_decrease = time(); @@ -192,7 +190,7 @@ return; { debuglog("* increase price $algo"); - $res = fetch_url("https://www.nicehash.com/api?method=orders.set.price&id=$apiid&key=$apikey&algo=$i&order=$order->id&price=$setprice"); + $res = fetch_url("https://www.nicehash.com/api?method=orders.set.price&id=$apiid&key=$apikey&algo=$i&location=0&order=$order->id&price=$setprice"); debuglog($res); } @@ -200,7 +198,7 @@ return; { debuglog("* increase speed $algo"); - $res = fetch_url("https://www.nicehash.com/api?method=orders.set.limit&id=$apiid&key=$apikey&algo=$i&order=$order->id&limit=0"); + $res = fetch_url("https://www.nicehash.com/api?method=orders.set.limit&id=$apiid&key=$apikey&location=0&algo=$i&order=$order->id&limit=0"); debuglog($res); }