Browse Source

Test

etomic
jl777 7 years ago
parent
commit
7e985f2604
  1. 3
      iguana/exchanges/LP_ordermatch.c
  2. 2
      iguana/exchanges/LP_utxos.c

3
iguana/exchanges/LP_ordermatch.c

@ -563,14 +563,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,
char *LP_bestfit(char *rel,double relvolume)
{
struct LP_utxoinfo *autxo; cJSON *retjson;
printf("LP_bestfit\n");
if ( relvolume <= 0. || LP_priceinfofind(rel) == 0 )
return(clonestr("{\"error\":\"invalid parameter\"}"));
printf("call LP_utxo_bestfit\n");
if ( (autxo= LP_utxo_bestfit(rel,SATOSHIDEN * relvolume)) == 0 )
return(clonestr("{\"error\":\"cant find utxo that is big enough\"}"));
retjson = LP_utxojson(autxo);
printf("autxo.%p %p\n",autxo,retjson);
return(jprint(retjson,1));
}

2
iguana/exchanges/LP_utxos.c

@ -342,7 +342,7 @@ struct LP_utxoinfo *LP_utxo_bestfit(char *symbol,uint64_t destsatoshis)
return(0);
HASH_ITER(hh,LP_utxoinfos[0],utxo,tmp)
{
//char str[65]; printf("check %s.%s\n",utxo->coin,bits256_str(str,utxo->payment.txid));
char str[65]; printf("check %s.%s avail.%d ismine.%d >= %d\n",utxo->coin,bits256_str(str,utxo->payment.txid),LP_isavailable(utxo) > 0,LP_ismine(utxo) > 0,utxo->S.satoshis >= destsatoshis);
if ( strcmp(symbol,utxo->coin) == 0 && LP_isavailable(utxo) > 0 && LP_ismine(utxo) > 0 )
{
if ( utxo->S.satoshis >= destsatoshis && (bestutxo == 0 || utxo->S.satoshis < bestutxo->S.satoshis) )

Loading…
Cancel
Save