From c5bfa7492c526d92f45f2b4f89b94834804bd8f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Sep 2017 15:51:21 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 11 +++++++---- iguana/exchanges/LP_ordermatch.c | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 504012b05..bb13642da 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -357,11 +357,12 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht { - int32_t height,i,n,m; bits256 zero; cJSON *array,*item,*array2; uint64_t total,total2; + int32_t height,i,n,m,post; bits256 zero; cJSON *array,*item,*array2; uint64_t total,total2; if ( coin->inactive != 0 ) continue; if ( (rand() % 100) == 0 ) { + post = 0; LP_listunspent_both(coin->symbol,coin->smartaddr); if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { @@ -393,10 +394,10 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } free_json(array2); } - if ( total != total || n != m ) + if ( total != total2 || n != m ) { - printf(">>>>>>>> compare %s %s (%.8f n%d) (%.8f m%d)\n",coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); - LP_postutxos(coin->symbol,coin->smartaddr); + printf(">>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); + post++; } free(retstr); } @@ -405,6 +406,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int } free_json(array); } + if ( post > 0 ) + LP_postutxos(coin->symbol,coin->smartaddr); } if ( coin->electrum != 0 ) continue; diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 25bb7a3e3..6ebc79aa9 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -749,7 +749,7 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) v = jint(item,"vout"); value = LP_value_extract(item,0); height = LP_txheight(coin,txid); - char str[65]; printf("LP_listunspent_both: %s/v%d ht.%d %.8f\n",bits256_str(str,txid),v,height,dstr(value)); + //char str[65]; printf("LP_listunspent_both: %s/v%d ht.%d %.8f\n",bits256_str(str,txid),v,height,dstr(value)); LP_address_utxoadd(coin,coinaddr,txid,v,value,height,-1); } }