Browse Source

Test

etomic
jl777 8 years ago
parent
commit
5ba4b50d4c
  1. 2
      iguana/exchanges/LP_quotes.c
  2. 12
      iguana/exchanges/LP_utxos.c

2
iguana/exchanges/LP_quotes.c

@ -222,7 +222,7 @@ cJSON *LP_tradecandidates(struct LP_utxoinfo *myutxo,char *base)
safecopy(coinstr,jstr(item,"base"),sizeof(coinstr));
if ( strcmp(coinstr,base) == 0 )
{
if ( LP_iseligible(Q.txid,Q.vout) != 0 )
if ( LP_iseligible(Q.srccoin,Q.txid,Q.vout,Q.value,Q.txid2,Q.vout2,Q.va.ue2) != 0 )
{
if ( LP_arrayfind(retarray,Q.txid,Q.vout) < 0 )
jaddi(retarray,jduplicate(item));

12
iguana/exchanges/LP_utxos.c

@ -145,17 +145,17 @@ char *LP_spentcheck(cJSON *argjson)
} else return(clonestr("{\"error\":\"cant find txid to check spent status\"}"));
}
int32_t LP_iseligible(bits256 txid,int32_t vout)
int32_t LP_iseligible(char *coin,bits256 txid,int32_t vout,uint64_t value,bits256 txid2,int32_t vout2,uint64_t value2)
{
struct LP_utxoinfo *utxo; uint64_t value; char str[65];
struct LP_utxoinfo *utxo; uint64_t val,val2; char str[65];
if ( (utxo= LP_utxofind(txid,vout)) != 0 )
{
if ( (value= LP_txvalue(utxo->coin,utxo->txid,utxo->vout)) == utxo->value )
if ( (val= LP_txvalue(coin,txid,vout)) != value )
{
if ( LP_txvalue(utxo->coin,utxo->txid2,utxo->vout2) == utxo->value2 )
if ( (val2= LP_txvalue(coin,txid2,vout2)) != value2 )
return(1);
else printf("mismatched txid value2 %.8f vs %.8f\n",dstr(value),dstr(utxo->value2));
} else printf("mismatched txid value %.8f vs %.8f\n",dstr(value),dstr(utxo->value));
else printf("mismatched txid value2 %.8f vs %.8f\n",dstr(val2),dstr(value2));
} else printf("mismatched txid value %.8f vs %.8f\n",dstr(val),dstr(value));
} else printf("cant find (%s/v%d)\n",bits256_str(str,txid),vout);
return(0);
}

Loading…
Cancel
Save