diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 5e0c28b39..30424456a 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -236,7 +236,7 @@ dividends(coin, height, )\n\ { if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); + return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume")*price,jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"))); } else return(clonestr("{\"error\":\"no price set\"}")); } } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c49df3c55..2daa76cbf 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -343,6 +343,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int free(retstr); peer->needping = 0; } + //sync listunspent, parse arrays in ordermatch, electrum history to prune, spv } } if ( peer->diduquery == 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 261fb1a82..379670a7c 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -729,12 +729,12 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) { if ( coin->electrum != 0 || LP_address_ismine(symbol,coinaddr) <= 0 ) { - printf("issue path electrum.%p\n",coin->electrum); + //printf("issue path electrum.%p\n",coin->electrum); n = LP_listunspent_issue(symbol,coinaddr); } else { - printf("my coin electrum.%p\n",coin->electrum); + //printf("my coin electrum.%p\n",coin->electrum); sprintf(buf,"[1, 99999999, [\"%s\"]]",coinaddr); if ( (array= bitcoin_json(coin,"listunspent",buf)) != 0 ) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 904c48d77..6b04e22e1 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -436,7 +436,7 @@ int32_t LP_address_ismine(char *symbol,char *address) if ( jobj(retjson,"ismine") != 0 && is_cJSON_True(jobj(retjson,"ismine")) != 0 ) { doneflag = 1; - printf("%s ismine (%s)\n",address,jprint(retjson,0)); + //printf("%s ismine (%s)\n",address,jprint(retjson,0)); } //printf("%s\n",jprint(retjson,0)); free_json(retjson); @@ -492,7 +492,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) LP_postutxos(symbol,coinaddr); // might be good to not saturate } } - printf("issue listunspent %s (%s)\n",coinaddr,jprint(retjson,0)); + //printf("issue listunspent %s (%s)\n",coinaddr,jprint(retjson,0)); if ( retjson != 0 ) free_json(retjson); if ( retstr != 0 ) diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 14825a425..5cbbabf43 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -438,7 +438,7 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid) int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t duration) { - struct iguana_info *coin; cJSON *array,*item; uint32_t expiration,i,n,numconfirms = -1; + struct iguana_info *coin; cJSON *array,*item; uint32_t expiration,i,n; int32_t numconfirms = -1; if ( (coin= LP_coinfind(symbol)) == 0 || coin->inactive != 0 ) { printf("LP_waitmempool missing coin.%p or inactive\n",coin); @@ -475,14 +475,13 @@ int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int LP_listunspent_issue(coin->symbol,coinaddr); struct LP_address_utxo *up; if ( (up= LP_address_utxofind(coin,coinaddr,txid,vout)) != 0 ) - //if ( (tx= LP_transactionfind(coin,txid)) != 0 && tx->height > 0 ) { char str[65]; printf("address_utxofind found confirmed %s %s ht.%d vs %d\n",symbol,bits256_str(str,txid),up->U.height,coin->height); if ( coin->height >= up->U.height ) numconfirms = (coin->height - up->U.height + 1); } } - if ( time(NULL) > expiration || numconfirms >= 1 ) + if ( time(NULL) > expiration || numconfirms >= 0 ) break; usleep(500000); }