Browse Source

Test

etomic
jl777 7 years ago
parent
commit
b6364d9a82
  1. 7
      iguana/exchanges/LP_nativeDEX.c
  2. 2
      iguana/exchanges/LP_utxo.c

7
iguana/exchanges/LP_nativeDEX.c

@ -323,6 +323,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer)
{
if ( IAMLP == 0 && coin->inactive != 0 )//|| (coin->electrum != 0 && coin->obooktime == 0) )
continue;
printf("UTXO sync %s -> %s\n",coin->symbol,peer->ipaddr);
total = 0;
LP_listunspent_both(coin->symbol,coin->smartaddr);
if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 )
@ -362,7 +363,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer)
}
if ( j == m )
{
printf("%s missing %s\n",peer->ipaddr,jprint(item,0));
printf("%s missing %s %s\n",peer->ipaddr,coin->symbol,jprint(item,0));
if ( (retstr2= issue_LP_uitem(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr,txid,v,jint(item,"height"),j64bits(item,"value"))) != 0 )
free(retstr2);
posted++;
@ -441,15 +442,15 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int
if ( IAMLP == 0 )
continue;
}
if ( now > peer->lastpeers+60 && peer->numpeers > 0 && (peer->numpeers != numpeers || (rand() % 1000) == 0) )
if ( now > peer->lastpeers+60 || (rand() % 10000) == 0 )
{
peer->lastpeers = now;
if ( strcmp(peer->ipaddr,myipaddr) != 0 )
{
LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport);
peer->diduquery = 0;
LP_utxos_sync(peer);
}
peer->lastpeers = now;
}
if ( peer->diduquery == 0 )
{

2
iguana/exchanges/LP_utxo.c

@ -234,7 +234,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,
DL_APPEND(ap->utxos,up);
portable_mutex_unlock(&coin->addrmutex);
retval = 1;
if ( 1 && height > 0 )
if ( 0 && height > 0 )
printf("ADDRESS_UTXO >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value));
}
} // else printf("cant get ap %s %s\n",coin->symbol,coinaddr);

Loading…
Cancel
Save