diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index d088e712a..c04beef58 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1010,15 +1010,15 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel destsatoshis = SATOSHIDEN * relvolume; if ( (autxo= LP_utxo_bestfit(rel,destsatoshis + 2*desttxfee)) == 0 ) return(clonestr("{\"error\":\"cant find alice utxo that is big enough\"}")); - if ( destsatoshis - 0*desttxfee < autxo->S.satoshis ) + if ( destsatoshis - desttxfee < autxo->S.satoshis ) { - //destsatoshis -= 2*desttxfee; + destsatoshis -= desttxfee; autxo->S.satoshis = destsatoshis; //printf("first path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->S.satoshis)); } - else if ( autxo->S.satoshis - 0*desttxfee < destsatoshis ) + else if ( autxo->S.satoshis - desttxfee < destsatoshis ) { - autxo->S.satoshis -= 0*desttxfee; + autxo->S.satoshis -= desttxfee; destsatoshis = autxo->S.satoshis; printf("second path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->S.satoshis)); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 547d67926..8abbb6a3c 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -897,10 +897,10 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) cJSON *strjson,*errjson,*resultjson,*paramsjson; char *method; int32_t i,n,height; uint32_t idnum=0; struct stritem *stritem; struct iguana_info *coin; struct queueitem *tmp,*item = 0; if ( str == 0 || len == 0 ) return(-1); - printf("RECV.(%s)\n",str); ep->lasttime = (uint32_t)time(NULL); if ( (strjson= cJSON_Parse(str)) != 0 ) { + printf("%s RECV.(%ld) id.%d\n",ep->symbol,strlen(str),jint(strjson,"id")); resultjson = jobj(strjson,"result"); //printf("strjson.(%s)\n",jprint(strjson,0)); if ( (method= jstr(strjson,"method")) != 0 )