Browse Source

Test

etomic
jl777 7 years ago
parent
commit
7098200f6a
  1. 12
      iguana/exchanges/LP_remember.c
  2. 6
      iguana/exchanges/LP_utxo.c

12
iguana/exchanges/LP_remember.c

@ -622,10 +622,11 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t
return(rswap->iambob);
}
int32_t _LP_refht_update(struct iguana_info *coin,int32_t refht)
int32_t _LP_refht_update(struct iguana_info *coin,bits256 txid,int32_t refht)
{
if ( refht > 0 && (coin->firstrefht == 0 || refht < coin->firstrefht) )
{
char str[65]; printf(">>>>>>>>. 1st refht %s %s <- %d, scan %d %d\n",coin->symbol,bits256_str(str,txid),refht,coin->firstscanht,coin->lastscanht);
if ( coin->firstscanht == 0 || refht < coin->firstscanht )
coin->firstscanht = coin->lastscanht = refht;
coin->firstrefht = refht;
@ -637,13 +638,10 @@ int32_t _LP_refht_update(struct iguana_info *coin,int32_t refht)
int32_t LP_refht_update(char *symbol,bits256 txid)
{
int32_t refht; struct iguana_info *coin;
if ( (coin= LP_coinfind(symbol)) != 0 ) // && coin->electrum == 0
if ( (coin= LP_coinfind(symbol)) != 0 && coin->electrum == 0 )
{
if ( (refht= LP_txheight(coin,txid)) > 0 && refht > 0 )
{
char str[65]; printf(">>>>>>>>. 1st refht %s %s <- %d, scan %d %d\n",coin->symbol,bits256_str(str,txid),refht,coin->firstscanht,coin->lastscanht);
return(_LP_refht_update(coin,refht));
}
return(_LP_refht_update(coin,txid,refht));
}
return(0);
}
@ -783,7 +781,7 @@ int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi
if ( coin != 0 && (tx= LP_transactionfind(coin,rswap->txids[txi])) != 0 && tx->height > 0 )
{
rswap->sentflags[txi] = 1;
_LP_refht_update(coin,tx->height);
_LP_refht_update(coin,rswap->txids[txi],tx->height);
} else LP_refht_update(symbol,rswap->txids[txi]);
}
return(0);

6
iguana/exchanges/LP_utxo.c

@ -671,9 +671,9 @@ int32_t LP_txheight(struct iguana_info *coin,bits256 txid)
if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 )
{
height = jint(blockobj,"height");
char str[65];
if ( strcmp(coin->symbol,"CHIPS") != 0 && strcmp(coin->symbol,"BTC") != 0 )
printf("%s %s LP_txheight.%d\n",coin->symbol,bits256_str(str,txid),height);
//char str[65];
//if ( strcmp(coin->symbol,"CHIPS") != 0 && strcmp(coin->symbol,"BTC") != 0 )
// printf("%s %s LP_txheight.%d\n",coin->symbol,bits256_str(str,txid),height);
free_json(blockobj);
} // else printf("%s LP_txheight error (%s)\n",coin->symbol,jprint(txobj,0)); likely just unconfirmed
free_json(txobj);

Loading…
Cancel
Save