Browse Source

Test

etomic
jl777 7 years ago
parent
commit
072b6fa902
  1. 31
      iguana/exchanges/LP_nativeDEX.c
  2. 8
      iguana/exchanges/LP_remember.c

31
iguana/exchanges/LP_nativeDEX.c

@ -619,24 +619,27 @@ void LP_coinsloop(void *_coins)
coin->lastscanht = coin->firstscanht;
continue;
}
nonz++;
if ( strcmp("BTC",coins) == 0 )//&& coin->lastscanht < coin->longestchain-3 )
printf("[%s]: %s ref.%d scan.%d to %d, longest.%d\n",coins,coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain);
for (j=0; j<100; j++)
if ( 0 )
{
if ( LP_blockinit(coin,coin->lastscanht) < 0 )
nonz++;
if ( strcmp("BTC",coins) == 0 )//&& coin->lastscanht < coin->longestchain-3 )
printf("[%s]: %s ref.%d scan.%d to %d, longest.%d\n",coins,coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain);
for (j=0; j<100; j++)
{
static uint32_t counter;
if ( counter++ < 3 )
printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht);
break;
if ( LP_blockinit(coin,coin->lastscanht) < 0 )
{
static uint32_t counter;
if ( counter++ < 3 )
printf("blockinit.%s %d error\n",coin->symbol,coin->lastscanht);
break;
}
coin->lastscanht++;
if ( coin->lastscanht == coin->longestchain+1 || strcmp("BTC",coins) == 0 )
break;
}
coin->lastscanht++;
if ( coin->lastscanht == coin->longestchain+1 || strcmp("BTC",coins) == 0 )
break;
if ( strcmp("BTC",coins) == 0 )
printf("done [%s]: %s ref.%d scan.%d to %d, longest.%d\n",coins,coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain);
}
if ( strcmp("BTC",coins) == 0 )
printf("done [%s]: %s ref.%d scan.%d to %d, longest.%d\n",coins,coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain);
}
if ( coins == 0 )
return;

8
iguana/exchanges/LP_remember.c

@ -256,9 +256,12 @@ bits256 basilisk_swap_privBn_extract(bits256 *bobrefundp,char *bobcoin,bits256 b
bits256 basilisk_swap_spendupdate(int32_t iambob,char *symbol,char *spentaddr,int32_t *sentflags,bits256 *txids,int32_t utxoind,int32_t alicespent,int32_t bobspent,int32_t vout,char *aliceaddr,char *bobaddr,char *Adest,char *dest)
{
bits256 spendtxid,txid; char destaddr[64],str[65]; int32_t i,n,m; struct iguana_info *coin; cJSON *array,*txobj,*vins,*vin;
if ( (coin= LP_coinfind(symbol)) != 0 && coin->electrum != 0 )
memset(&spendtxid,0,sizeof(spendtxid));
if ( (coin= LP_coinfind(symbol)) == 0 )
return(spendtxid);
printf("spentaddr.%s aliceaddr.%s bobaddr.%s Adest.%s Bdest.%s\n",spentaddr,aliceaddr,bobaddr,Adest,dest);
if ( coin->electrum != 0 )
{
//printf("spentaddr.%s aliceaddr.%s bobaddr.%s Adest.%s Bdest.%s\n",spentaddr,aliceaddr,bobaddr,Adest,dest);
if ( (array= electrum_address_gethistory(symbol,coin->electrum,&array,spentaddr,txids[utxoind])) != 0 )
{
if ( (n= cJSON_GetArraySize(array)) > 0 )
@ -287,7 +290,6 @@ bits256 basilisk_swap_spendupdate(int32_t iambob,char *symbol,char *spentaddr,in
}
}
txid = txids[utxoind];
memset(&spendtxid,0,sizeof(spendtxid));
if ( bits256_nonz(txid) != 0 )//&& sentflags[utxoind] != 0 )
{
destaddr[0] = 0;

Loading…
Cancel
Save