Browse Source

Test

etomic
jl777 7 years ago
parent
commit
76dcacdbe4
  1. 18
      iguana/exchanges/LP_utxo.c

18
iguana/exchanges/LP_utxo.c

@ -118,22 +118,22 @@ struct LP_utxoinfo *LP_allocated(bits256 txid,int32_t vout)
struct LP_utxoinfo *utxo;
if ( (utxo= _LP_utxofind(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 )
{
char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout);
//char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout);
return(utxo);
}
if ( (utxo= _LP_utxo2find(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 )
{
char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout);
//char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout);
return(utxo);
}
if ( (utxo= _LP_utxofind(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 )
{
char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout);
//char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout);
return(utxo);
}
if ( (utxo= _LP_utxo2find(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 )
{
char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout);
//char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout);
return(utxo);
}
return(0);
@ -976,10 +976,14 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol
int32_t LP_inventory_prevent(int32_t iambob,char *symbol,bits256 txid,int32_t vout)
{
struct LP_utxoinfo *utxo; struct LP_transaction *tx; struct iguana_info *coin;
struct LP_address_utxo *up; struct LP_utxoinfo *utxo; struct LP_transaction *tx; struct iguana_info *coin;
if ( (coin= LP_coinfind(symbol)) == 0 )
return(1);
if ( LP_allocated(txid,vout) != 0 )
return(1);
if ( (utxo= LP_utxofind(iambob,txid,vout)) != 0 || (utxo= LP_utxo2find(iambob,txid,vout)) != 0 )
{
if ( (coin= LP_coinfind(symbol)) != 0 && (tx= LP_transactionfind(coin,txid)) != 0 )
if ( coin != 0 && (tx= LP_transactionfind(coin,txid)) != 0 )
{
if ( tx->outpoints[vout].spendheight > 0 )
utxo->T.spentflag = tx->outpoints[vout].spendheight;
@ -991,6 +995,8 @@ int32_t LP_inventory_prevent(int32_t iambob,char *symbol,bits256 txid,int32_t vo
return(1);
}
}
if ( (up= LP_address_utxofind(coin,coin->smartaddr,txid,vout)) != 0 && up->spendheight > 0 )
return(1);
return(0);
}

Loading…
Cancel
Save