diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 18a010a31..fbc22e7c1 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -150,7 +150,7 @@ int32_t LP_subsock_check(char *myipaddr,int32_t pubsock,int32_t sock,double prof nonz++; if ( (argjson= cJSON_Parse((char *)ptr)) != 0 ) { - printf("%s SUB.[%d] %s\n",myipaddr,recvsize,jprint(argjson,0)); + //printf("%s SUB.[%d] %s\n",myipaddr,recvsize,jprint(argjson,0)); portable_mutex_lock(&LP_commandmutex); if ( (retstr= LP_command_process(myipaddr,-1,argjson,0,0,profitmargin)) != 0 ) { diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index e71afef66..4faf2e2a5 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -43,7 +43,7 @@ int32_t LP_send(int32_t sock,char *msg,int32_t freeflag) { if ( (sentbytes= nn_send(sock,msg,len,0)) != len ) printf("LP_send sent %d instead of %d\n",sentbytes,len); - else printf("SENT.(%s)\n",msg); + //else printf("SENT.(%s)\n",msg); if ( freeflag != 0 ) free(msg); return(sentbytes); diff --git a/iguana/exchanges/LP_quotes.c b/iguana/exchanges/LP_quotes.c index 4c53039b1..fd3b8af26 100644 --- a/iguana/exchanges/LP_quotes.c +++ b/iguana/exchanges/LP_quotes.c @@ -181,7 +181,7 @@ char *LP_pricepings(char *myipaddr,int32_t pubsock,double profitmargin,char *bas if ( pubsock >= 0 ) { jaddstr(reqjson,"method","postprice"); - printf("%d pricepings.(%s)\n",pubsock,jprint(reqjson,0)); + //printf("%d pricepings.(%s)\n",pubsock,jprint(reqjson,0)); LP_send(pubsock,jprint(reqjson,1),1); } else @@ -197,7 +197,7 @@ char *LP_pricepings(char *myipaddr,int32_t pubsock,double profitmargin,char *bas char *LP_postedprice(cJSON *argjson) { bits256 pubkey; double price; char *base,*rel; - printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); + //printf("PRICE POSTED.(%s)\n",jprint(argjson,0)); if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL ) { pubkey = jbits256(argjson,"pubkey"); @@ -246,7 +246,7 @@ double LP_query(char *myipaddr,int32_t mypubsock,double profitmargin,char *metho reqjson = LP_quotejson(qp); if ( bits256_nonz(qp->desthash) != 0 ) flag = 1; - printf("QUERY.(%s)\n",jprint(reqjson,0)); + //printf("QUERY.(%s)\n",jprint(reqjson,0)); if ( IAMLP != 0 ) { jaddstr(reqjson,"method",method); @@ -384,7 +384,13 @@ char *LP_connectedalice(cJSON *argjson) // alice } else jaddstr(retjson,"error","couldnt aliceloop"); } return(jprint(retjson,1)); - } else return(clonestr("{\"result\",\"update stats\"}")); + } + else + { + utxo = LP_utxofind(0,Q.desttxid,Q.destvout); + printf("alice fails %d %d %d %d %d\n",IAMLP == 0,bits256_cmp(Q.desthash,LP_mypubkey) == 0, utxo != 0,LP_ismine(utxo) > 0,LP_isavailable(utxo) > 0); + return(clonestr("{\"result\",\"update stats\"}")); + } } int32_t LP_tradecommand(char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen,double profitmargin) diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 579be508a..b83c019e6 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -20,21 +20,21 @@ int32_t LP_ismine(struct LP_utxoinfo *utxo) { - if ( bits256_cmp(utxo->pubkey,LP_mypubkey) == 0 ) + if ( utxo != 0 && bits256_cmp(utxo->pubkey,LP_mypubkey) == 0 ) return(1); else return(0); } int32_t LP_isavailable(struct LP_utxoinfo *utxo) { - if ( utxo->T.swappending == 0 && utxo->S.swap == 0 ) + if ( utxo != 0 && utxo->T.swappending == 0 && utxo->S.swap == 0 ) return(1); else return(0); } int32_t LP_isunspent(struct LP_utxoinfo *utxo) { - if ( utxo->T.spentflag == 0 && LP_isavailable(utxo) > 0 ) + if ( utxo != 0 && utxo->T.spentflag == 0 && LP_isavailable(utxo) > 0 ) return(1); else return(0); }