From 9c49451d878e4bf6b554a2210166b39685241010 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 16:03:18 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 37 +++++++++++++++------------------ 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index d8dea68ee..9c3419f72 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -484,7 +484,7 @@ dividends(coin, height, )\n\ { if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_mypriv25519) != 0 ) { - //printf("%s %s is my address being asked for!\n",ptr->symbol,coinaddr); + printf("ADDR_UNSPENTS %s %s is my address being asked for!\n",ptr->symbol,coinaddr); ptr->addr_listunspent_requested = (uint32_t)time(NULL); } } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7b8c5a05f..30500c2d0 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -349,27 +349,24 @@ void LP_smartutxos_push(struct iguana_info *coin) vout = jint(item,"tx_pos"); value = j64bits(item,"value"); height = jint(item,"height"); - if ( 0 ) + if ( IAMLP == 0 ) { - HASH_ITER(hh,LP_peerinfos,peer,tmp) - { - if ( (retstr= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,vout,height,value)) != 0 ) - free(retstr); - } - } - else - { - req = cJSON_CreateObject(); - jaddstr(req,"method","uitem"); - jaddstr(req,"coin",coin->symbol); - jaddstr(req,"coinaddr",coin->smartaddr); - jaddbits256(req,"txid",txid); - jaddnum(req,"vout",vout); - jaddnum(req,"ht",height); - jadd64bits(req,"value",value); - //printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); - LP_reserved_msg("","",zero,jprint(req,1)); + HASH_ITER(hh,LP_peerinfos,peer,tmp) + { + if ( (retstr= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,vout,height,value)) != 0 ) + free(retstr); + } } + req = cJSON_CreateObject(); + jaddstr(req,"method","uitem"); + jaddstr(req,"coin",coin->symbol); + jaddstr(req,"coinaddr",coin->smartaddr); + jaddbits256(req,"txid",txid); + jaddnum(req,"vout",vout); + jaddnum(req,"ht",height); + jadd64bits(req,"value",value); + printf("ADDR_UNSPENTS[] <- %s\n",jprint(req,0)); + LP_reserved_msg("","",zero,jprint(req,1)); } } free_json(array); @@ -564,7 +561,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int memset(&zero,0,sizeof(zero)); if ( coin->addr_listunspent_requested != 0 ) { - //printf("addr_listunspent_requested %u\n",coin->addr_listunspent_requested); + printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); LP_smartutxos_push(coin); coin->addr_listunspent_requested = 0; }