jl777 7 years ago
parent
commit
54dd52559b
  1. 17
      iguana/exchanges/LP_remember.c

17
iguana/exchanges/LP_remember.c

@ -804,19 +804,18 @@ void LP_txbytes_update(char *name,char *symbol,char *txbytes,bits256 *txidp,bits
int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi) int32_t LP_rswap_checktx(struct LP_swap_remember *rswap,char *symbol,int32_t txi)
{ {
struct LP_transaction *tx=0; struct iguana_info *coin; char str[65]; int32_t ht; struct LP_transaction *tx=0; struct iguana_info *coin; char str[65];
if ( rswap->sentflags[txi] == 0 && bits256_nonz(rswap->txids[txi]) != 0 ) if ( rswap->sentflags[txi] == 0 && bits256_nonz(rswap->txids[txi]) != 0 )
{ {
coin = LP_coinfind(symbol); if ( (coin= LP_coinfind(symbol)) != 0 )
if ( coin != 0 && (tx= LP_transactionfind(coin,rswap->txids[txi])) != 0 )
{ {
rswap->sentflags[txi] = 1; if ( (ht= LP_txheight(coin,rswap->txids[txi])) > 0 )
if ( tx->height <= 0 ) {
tx->height = LP_txheight(coin,rswap->txids[txi]); rswap->sentflags[txi] = 1;
if ( tx->height > 0 )
_LP_refht_update(coin,rswap->txids[txi],tx->height); _LP_refht_update(coin,rswap->txids[txi],tx->height);
} else LP_refht_update(symbol,rswap->txids[txi]); } else LP_refht_update(symbol,rswap->txids[txi]);
printf("[%s] %s txbytes.%p %s ht.%d\n",txnames[txi],txnames[txi],rswap->txbytes[txi],bits256_str(str,rswap->txids[txi]),tx!=0?tx->height:-1); printf("[%s] %s txbytes.%p %s ht.%d\n",txnames[txi],txnames[txi],rswap->txbytes[txi],bits256_str(str,rswap->txids[txi]),tx!=0?tx->height:-1);
}
} else printf("sent.%d %s txi.%d\n",rswap->sentflags[txi],bits256_str(str,rswap->txids[txi]),txi); } else printf("sent.%d %s txi.%d\n",rswap->sentflags[txi],bits256_str(str,rswap->txids[txi]),txi);
return(0); return(0);
} }

Loading…
Cancel
Save