diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 32ee01428..dd5044682 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -393,7 +393,7 @@ int32_t LP_priceping(int32_t pubsock,struct LP_utxoinfo *utxo,char *rel,double p int32_t LP_command(struct LP_peerinfo *mypeer,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen,double profitmargin) { char *method,*base,*rel,*retstr,pairstr[512]; cJSON *retjson; double price; bits256 privkey,txid; struct LP_utxoinfo *utxo; int32_t retval = -1,DEXselector = 0; uint64_t destvalue; struct basilisk_request R; struct LP_quoteinfo Q; - if ( (method= jstr(argjson,"method")) != 0 ) + if ( IAMCLIENT == 0 && (method= jstr(argjson,"method")) != 0 ) { txid = jbits256(argjson,"txid"); if ( (utxo= LP_utxofind(txid,jint(argjson,"vout"))) != 0 && strcmp(utxo->ipaddr,mypeer->ipaddr) == 0 && utxo->port == mypeer->port && (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && strcmp(base,utxo->coin) == 0 ) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 84a7cb512..ff2e35c11 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -29,7 +29,7 @@ int32_t LP_send(int32_t sock,char *msg,int32_t freeflag) int32_t sentbytes,len,i; struct nn_pollfd pfd; if ( sock < 0 ) { - printf("LP_send to illegal socket\n"); + printf("LP_send.(%s) to illegal socket\n",msg); if ( freeflag != 0 ) free(msg); return(-1); diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 6cfc332cf..bf3017da3 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -836,9 +836,9 @@ int main(int argc, const char * argv[]) free(retstr); } incr = 100.; - while ( 1 ) + while ( IAMCLIENT != 0 ) { - theoretical = marketmaker_updateprice("komodo","KMD","BTC",theoretical,&incr); + theoretical = marketmaker_updateprice("komodo","REVS","KMD",theoretical,&incr); sleep(3); LP_privkey_updates(0,-1,passphrase,1); if ( jint(retjson,"client") != 0 ) @@ -846,12 +846,13 @@ int main(int argc, const char * argv[]) struct LP_utxoinfo *utxo,*utmp; HASH_ITER(hh,LP_utxoinfos,utxo,utmp) { - if ( (matchjson= LP_autotrade(utxo,"KMD",0.)) != 0 ) + if ( strcmp(utxo->coin,"REVS") == 0 && (matchjson= LP_autotrade(utxo,"KMD",0.)) != 0 ) printf("bestprice (%s)\n",jprint(matchjson,1)); } } sleep(1000); } +getchar(); profitmargin = jdouble(retjson,"profitmargin"); minask = jdouble(retjson,"minask"); maxbid = jdouble(retjson,"maxbid");