From 6efaf41a9f4f472d2d2208c8a0285f4766f7f95d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 4 Jun 2017 21:06:45 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_commands.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 38016a30a..6390f541d 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -248,13 +248,14 @@ cJSON *LP_tradecandidates(struct LP_utxoinfo *myutxo,char *base) { item = jitem(array,i); LP_quoteparse(&Q,item); - printf(">>>> i.%d %.8f %.8f Q: price %.8f\n",i,dstr(myutxo->satoshis),dstr(Q.destsatoshis),jdouble(item,"price")); safecopy(coinstr,jstr(item,"base"),sizeof(coinstr)); if ( strcmp(coinstr,base) == 0 ) { icopy = 0; if ( (price= LP_pricecache(&Q,base,myutxo->coin,jbits256(item,"txid"),jint(item,"vout"))) != 0. ) { + if ( Q.destsatoshis == 0 ) + Q.destsatoshis = Q.satoshis * price; if ( LP_sizematch(myutxo->satoshis,Q.destsatoshis) == 0 ) icopy = jduplicate(item); } else icopy = jduplicate(item); @@ -264,6 +265,7 @@ cJSON *LP_tradecandidates(struct LP_utxoinfo *myutxo,char *base) jaddnum(icopy,"price",price); jaddi(retarray,icopy); } + printf(">>>> i.%d %.8f %.8f Q: price %.8f -> %.8f\n",i,dstr(myutxo->satoshis),dstr(Q.destsatoshis),price,price * dstr(Q.satoshis)); } } }