Browse Source

Test

etomic
jl777 7 years ago
parent
commit
76601ae7d1
  1. 2
      iguana/exchanges/LP_commands.c
  2. 2
      iguana/exchanges/LP_ordermatch.c

2
iguana/exchanges/LP_commands.c

@ -208,7 +208,7 @@ forwardhex(pubkey,hex)\n\
else if ( strcmp(method,"notified") == 0 ) else if ( strcmp(method,"notified") == 0 )
{ {
LP_utxoaddjson(1,LP_mypubsock,argjson); LP_utxoaddjson(1,LP_mypubsock,argjson);
retstr = clonestr("{\"result\":\"success\",\"notifyutxo\":\"received\"}"); return(clonestr("{\"result\":\"success\",\"notifyutxo\":\"received\"}"));
} }
else if ( IAMLP != 0 ) else if ( IAMLP != 0 )
{ {

2
iguana/exchanges/LP_ordermatch.c

@ -563,7 +563,7 @@ char *LP_autotrade(char *myipaddr,int32_t mypubsock,double profitmargin,char *ba
{ {
destsatoshis = (butxo->S.satoshis * price); destsatoshis = (butxo->S.satoshis * price);
if ( destsatoshis > autxo->payment.value-desttxfee ) if ( destsatoshis > autxo->payment.value-desttxfee )
destsatoshis *= ((double)autxo->payment.value / (destsatoshis - desttxfee)); destsatoshis *= ((double)autxo->payment.value / (destsatoshis + desttxfee));
if ( destsatoshis > desttxfee && destsatoshis-desttxfee > (autxo->payment.value >> 1) && destsatoshis/price-txfee > (butxo->S.satoshis >> 1) ) if ( destsatoshis > desttxfee && destsatoshis-desttxfee > (autxo->payment.value >> 1) && destsatoshis/price-txfee > (butxo->S.satoshis >> 1) )
{ {
printf("price %.8f/%.8f best %.8f destsatoshis %.8f * metric %.8f -> (%f)\n",price,bestprice,bestmetric,dstr(destsatoshis),metric,dstr(destsatoshis) * metric * metric * metric); printf("price %.8f/%.8f best %.8f destsatoshis %.8f * metric %.8f -> (%f)\n",price,bestprice,bestmetric,dstr(destsatoshis),metric,dstr(destsatoshis) * metric * metric * metric);

Loading…
Cancel
Save