From 905ca8f620dcd679fad9d725da0affceefa19a88 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Sep 2017 20:59:08 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_network.c | 2 ++ iguana/exchanges/LP_ordermatch.c | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 1984ebfea..86f1eca78 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -207,7 +207,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, if ( (retstr= LP_command_process(ctx,myipaddr,pubsock,argjson,&((uint8_t *)ptr)[len],recvlen - len)) != 0 ) { } - //if ( jobj(argjson,"method") != 0 && strncmp(jstr(argjson,"method"),"connect",7) == 0 ) + if ( jobj(argjson,"method") != 0 && (strncmp(jstr(argjson,"method"),"connect",7) == 0 || strncmp(jstr(argjson,"method"),"reserve",7) == 0) ) fprintf(stderr,"finished %s\n",jsonstr); free_json(argjson); } diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index de2861cd1..30b83e127 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -314,6 +314,8 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 if ( strncmp(method,"connect",7) == 0 || strcmp(method,"reserved") == 0 ) printf("CRC32.%u (%s)\n",crc32,msgstr); LP_broadcast_finish(pubsock,base,rel,msg,argjson,0); + if ( strncmp(method,"connect",7) == 0 || strcmp(method,"reserved") == 0 ) + printf("finished %u\n",crc32); } // else printf("no valid method in (%s)\n",msgstr); free_json(argjson); } else printf("couldnt parse (%s)\n",msgstr); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 104a98872..c50265c66 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -768,9 +768,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, butxo->T.lasttime = (uint32_t)time(NULL); printf("set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",butxo->T.swappending,qprice,price,msg); { - //bits256 zero; - //memset(&zero,0,sizeof(zero)); - LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); + bits256 zero; + memset(&zero,0,sizeof(zero)); + LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,zero,msg);//butxo->S.otherpubkey,msg); LP_butxo_swapfields_set(butxo); printf("return after RESERVED\n"); return(0);