Browse Source

Test

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

2
iguana/exchanges/LP_commands.c

@ -162,7 +162,7 @@ char *LP_connected(cJSON *argjson) // alice
int32_t LP_tradecommand(char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen,double profitmargin)
{
char *method,*base,*rel,*retstr; cJSON *retjson; double price; bits256 txid,spendtxid; struct LP_utxoinfo *utxo; int32_t selector,spendvini,retval = -1; struct LP_quoteinfo Q;
if ( (method= jstr(argjson,"method")) != 0 )
if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 || strcmp(method,"price") == 0 || strcmp(method,"connect") == 0) )
{
txid = jbits256(argjson,"txid");
if ( (utxo= LP_utxofind(1,txid,jint(argjson,"vout"))) != 0 && LP_ismine(utxo) > 0 && (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && strcmp(base,utxo->coin) == 0 )

2
iguana/exchanges/LP_nativeDEX.c

@ -103,7 +103,7 @@ int32_t LP_pullsock_check(char *myipaddr,int32_t pubsock,int32_t pullsock,double
if ( (retstr= LP_forwardhex(jbits256(argjson,"pubkey"),jstr(argjson,"hex"))) != 0 )
free(retstr);
}
else if ( LP_tradecommand(myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvsize - len,profitmargin) == 0 )
else if ( LP_tradecommand(myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvsize - len,profitmargin) <= 0 )
{
if ( (retstr= stats_JSON(argjson,"127.0.0.1",0)) != 0 )
{

Loading…
Cancel
Save