Browse Source

Test

etomic
jl777 8 years ago
parent
commit
b6aaf8e674
  1. 6
      iguana/exchanges/LP_commands.c
  2. 2
      iguana/exchanges/LP_nativeDEX.c

6
iguana/exchanges/LP_commands.c

@ -214,11 +214,11 @@ cJSON *LP_bestprice(struct LP_utxoinfo *utxo,char *base)
item = jitem(array,i);
if ( (price= jdouble(item,"price")) == 0. )
{
// horrible, pass in quoteinfo, utxo
printf("i.%d of %d: (%s)\n",i,n,jprint(item,0));
LP_quoteparse(&Q[i],item);
price = LP_query("price",&Q[i],jstr(item,"ipaddr"),jint(item,"port"),base,utxo->coin,zero);
if ( Q[i].destsatoshis != 0 && (double)j64bits(item,"value")/Q[i].destsatoshis > price )
price = (double)j64bits(item,"value")/Q[i].destsatoshis;
if ( Q[i].destsatoshis != 0 && (double)j64bits(item,"satoshis")/Q[i].destsatoshis > price )
price = (double)j64bits(item,"satoshis")/Q[i].destsatoshis;
}
if ( (prices[i]= price) != 0. && (bestprice == 0. || price < bestprice) )
bestprice = price;

2
iguana/exchanges/LP_nativeDEX.c

@ -460,7 +460,7 @@ char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port,
char *issue_LP_notifyutxo(char *destip,uint16_t destport,struct LP_utxoinfo *utxo)
{
char url[4096],str[65],str2[65];
sprintf(url,"http://%s:%u/api/stats/notifyutxo?ipaddr=%s&port=%u&profit=%.6f&coin=%s&txid=%s&vout=%d&value=%.8f&deposit=%s&dvout=%d&dvalue=%.8f&script=%s&address=%s",destip,destport,utxo->ipaddr,utxo->port,utxo->profitmargin,utxo->coin,bits256_str(str,utxo->txid),utxo->vout,dstr(utxo->satoshis),bits256_str(str2,utxo->txid2),utxo->vout2,dstr(utxo->satoshis2),utxo->spendscript,utxo->coinaddr);
sprintf(url,"http://%s:%u/api/stats/notifyutxo?ipaddr=%s&port=%u&profit=%.6f&coin=%s&txid=%s&vout=%d&value=%.8f&txid2=%s&vout2=%d&value2=%.8f&script=%s&address=%s",destip,destport,utxo->ipaddr,utxo->port,utxo->profitmargin,utxo->coin,bits256_str(str,utxo->txid),utxo->vout,dstr(utxo->satoshis),bits256_str(str2,utxo->txid2),utxo->vout2,dstr(utxo->satoshis2),utxo->spendscript,utxo->coinaddr);
if ( strlen(url) > 1024 )
printf("WARNING long url.(%s)\n",url);
return(issue_curl(url));

Loading…
Cancel
Save