From 4f89f224f0c74d73bd5f3b72113b971c14bad0f2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 16 Sep 2017 15:31:26 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 1 + iguana/exchanges/LP_network.c | 2 +- iguana/exchanges/LP_socket.c | 2 +- iguana/exchanges/LP_utxo.c | 6 +++--- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index fb492573f..a81626a0b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -51,6 +51,7 @@ uint16_t LP_fixed_pairport,LP_publicport; int32_t LP_mybussock = -1; int32_t LP_mypubsock = -1; int32_t LP_mypullsock = -1; +int32_t LP_mypushsock = -1; int32_t LP_pendingswaps,LP_showwif,USERPASS_COUNTER,IAMLP = 0; uint32_t LP_sessionid; double LP_profitratio = 1.; diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index aadc2f485..7686d816d 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -311,7 +311,7 @@ void LP_broadcast_message(int32_t pubsock,char *base,char *rel,bits256 destpub25 jdelete(argjson,"method2"); jaddstr(argjson,"method2",method); jaddstr(argjson,"method",method); - //printf("CRC32.%u (%s)\n",crc32,(char *)msg); + printf("CRC32.%u (%s)\n",crc32,(char *)msg); LP_broadcast_finish(pubsock,base,rel,msg,argjson,0); } // else printf("no valid method in (%s)\n",msgstr); free_json(argjson); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 9d825da63..d92fc720a 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -468,7 +468,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON { //printf("LISTUNSPENT.(%s)\n",jprint(retjson,0)); if ( electrum_process_array(coin,addr,retjson) != 0 ) - LP_postutxos(LP_mypubsock,coin->symbol); + LP_postutxos(LP_mypushsock,coin->symbol); strcpy(coin->lastunspent,addr); coin->unspenttime = (uint32_t)time(NULL); } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index a9acf863e..543167a4b 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -180,7 +180,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum return(array); } -void LP_postutxos(int32_t pubsock,char *symbol) +void LP_postutxos(int32_t sock,char *symbol) { bits256 zero; char *msg; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject(); if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) @@ -196,8 +196,8 @@ void LP_postutxos(int32_t pubsock,char *symbol) jaddstr(reqjson,"coinaddr",coin->smartaddr); jadd(reqjson,"utxos",array); msg = jprint(reqjson,1); - printf("post (%s)\n",msg); - LP_broadcast_message(pubsock,symbol,symbol,zero,msg); + printf("post (%s) -> %d\n",msg,LP_mypubsock); + LP_broadcast_message(LP_mypubsock,symbol,symbol,zero,msg); } } }