diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 6c6deb35b..f9616e367 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -358,28 +358,31 @@ 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; bits256 zero; cJSON *array; int32_t n; - LP_listunspent_both(coin->symbol,coin->smartaddr); - if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) + if ( coin->inactive != 0 ) + continue; + if ( (rand() % 100) == 0 ) { - if ( (n= cJSON_GetArraySize(array)) > 0 ) + LP_listunspent_both(coin->symbol,coin->smartaddr); + if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { - printf("[%s]\n\n",jprint(array,0)); - HASH_ITER(hh,LP_peerinfos,peer,tmp) + if ( (n= cJSON_GetArraySize(array)) > 0 ) { - if ( peer->errors < LP_MAXPEER_ERRORS ) + printf("[%s]\n\n",jprint(array,0)); + HASH_ITER(hh,LP_peerinfos,peer,tmp) { - if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) + if ( strcmp(peer->ipaddr,LP_myipaddr) != 0 && peer->errors < LP_MAXPEER_ERRORS ) { - printf(">>>>>>>> compare %s %s (%s)\n",coin->symbol,coin->smartaddr,retstr); - free(retstr); + if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) + { + printf(">>>>>>>> compare %s %s (%s)\n",coin->symbol,coin->smartaddr,retstr); + free(retstr); + } } } } + free_json(array); } - free_json(array); } - if ( coin->inactive != 0 ) - continue; if ( coin->electrum != 0 ) continue; memset(zero.bytes,0,sizeof(zero)); diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 80f1f230b..de90fcb96 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -472,7 +472,7 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON * item = jitem(retjson,i); txid = jbits256(item,"tx_hash"); height = jint(item,"height"); - char str[65]; printf("history txinit %s ht.%d\n",bits256_str(str,txid),height); + //char str[65]; printf("history txinit %s ht.%d\n",bits256_str(str,txid),height); txobj = LP_transactioninit(coin,txid,0,0); txobj = LP_transactioninit(coin,txid,1,txobj); if ( txobj != 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 6f0dc3f84..8ed5aa5e4 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -185,12 +185,13 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, { if ( vout == up->U.vout && bits256_cmp(up->U.txid,txid) == 0 ) { + flag = 1; if ( up->U.height <= 0 && height > 0 && up->U.height != height ) - up->U.height = height, flag = 1; + up->U.height = height, flag |= 2; if ( spendheight > 0 && up->spendheight != spendheight ) - up->spendheight = spendheight, flag = 1; + up->spendheight = spendheight, flag |= 4; if ( up->U.value == 0 && up->U.value != value ) - up->U.value = value, flag = 1; + up->U.value = value, flag |= 8; break; } }