diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index bb13642da..e703bed80 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -357,7 +357,8 @@ 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,post; bits256 zero; cJSON *array,*item,*array2; uint64_t total,total2; + int32_t height,i,j,n,m,v,post; bits256 zero,txid,txid2; cJSON *array,*item,*item2,*array2; uint64_t total,total2; + memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; if ( (rand() % 100) == 0 ) @@ -387,18 +388,33 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int if ( (m= cJSON_GetArraySize(array2)) > 0 ) { for (i=0; i>>>>>>> %s compare %s %s (%.8f n%d) (%.8f m%d)\n",peer->ipaddr,coin->symbol,coin->smartaddr,dstr(total),n,dstr(total2),m); + for (i=0; iipaddr,jprint(item,0)); + } } + post++; } free_json(array2); } - if ( total != total2 || n != m ) - { - 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); } } diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index 5294b71f2..4f2e21d35 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -1527,6 +1527,30 @@ char *issue_LP_clientgetutxos(char *destip,uint16_t destport,char *coin,int32_t //printf("%s clientgetutxos.(%s)\n",url,retstr); //return(retstr); } +void LP_address_monitor(struct LP_pubkeyinfo *pubp) +{ + struct iguana_info *coin,*tmp; char coinaddr[64]; cJSON *retjson; struct LP_address *ap; + return; + HASH_ITER(hh,LP_coins,coin,tmp) + { + bitcoin_address(coinaddr,coin->taddr,coin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); + portable_mutex_lock(&coin->addrmutex); + if ( (ap= _LP_address(coin,coinaddr)) != 0 ) + { + ap->monitor = (uint32_t)time(NULL); + } + portable_mutex_unlock(&coin->addrmutex); + if ( coin->electrum != 0 ) + { + if ( (retjson= electrum_address_subscribe(coin->symbol,coin->electrum,&retjson,coinaddr)) != 0 ) + { + printf("%s MONITOR.(%s) -> %s\n",coin->symbol,coinaddr,jprint(retjson,0)); + free_json(retjson); + } + } + } +} + /*else if ( strcmp(method,"ordermatch") == 0 ) { if ( price > SMALLVAL ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 8ed5aa5e4..8afc2a18f 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -331,31 +331,6 @@ char *LP_postedutxos(cJSON *argjson) return(clonestr("{\"result\":\"success\"}")); } -/*void LP_address_monitor(struct LP_pubkeyinfo *pubp) -{ - struct iguana_info *coin,*tmp; char coinaddr[64]; cJSON *retjson; struct LP_address *ap; - return; - HASH_ITER(hh,LP_coins,coin,tmp) - { - bitcoin_address(coinaddr,coin->taddr,coin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); - portable_mutex_lock(&coin->addrmutex); - if ( (ap= _LP_address(coin,coinaddr)) != 0 ) - { - ap->monitor = (uint32_t)time(NULL); - } - portable_mutex_unlock(&coin->addrmutex); - if ( coin->electrum != 0 ) - { - if ( (retjson= electrum_address_subscribe(coin->symbol,coin->electrum,&retjson,coinaddr)) != 0 ) - { - printf("%s MONITOR.(%s) -> %s\n",coin->symbol,coinaddr,jprint(retjson,0)); - free_json(retjson); - } - } - } -} -*/ - void LP_utxosetkey(uint8_t *key,bits256 txid,int32_t vout) { memcpy(key,txid.bytes,sizeof(txid));