diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index dc8ec5b77..27775d77b 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -118,7 +118,8 @@ cJSON *LP_tradecandidates(struct LP_utxoinfo *myutxo,char *base) } else icopy = jduplicate(item); if ( icopy != 0 ) { - jaddnum(icopy,"price",price); + if ( price != 0. ) + jaddnum(icopy,"price",price); jaddi(retarray,icopy); } } @@ -178,7 +179,12 @@ cJSON *LP_bestprice(struct LP_utxoinfo *utxo,char *base) } } if ( besti >= 0 ) + { bestitem = jduplicate(jitem(array,besti)); + if ( jobj(bestitem,"price") != 0 ) + jdelete(bestitem,"price"); + jaddnum(bestitem,"price",prices[besti]); + } } free_json(array); }