diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index ff4ee3dd7..fed378733 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -170,7 +170,7 @@ char *LP_quotereceived(cJSON *argjson) if ( (ptr= LP_cacheadd(Q.srccoin,Q.destcoin,Q.txid,Q.vout,price,&Q)) != 0 ) { ptr->Q = Q; - printf("\n>>>>>>>>>> received.(%s) quote %.8f\n\n",jprint(argjson,0),price); + printf("\n>>>>>>>>>> received quote %.8f\n\n",price); return(clonestr("{\"result\":\"updated\"}")); } else return(clonestr("{\"error\":\"nullptr\"}")); } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index f9ed9828c..361553dbb 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -453,9 +453,9 @@ static int _cmp_orderbook(const void *a,const void *b) #define ptr_a (*(struct LP_orderbookentry **)a)->price #define ptr_b (*(struct LP_orderbookentry **)b)->price if ( ptr_b > ptr_a ) - retval = 1; - else if ( ptr_b < ptr_a ) retval = -1; + else if ( ptr_b < ptr_a ) + retval = 1; else { #undef ptr_a @@ -463,9 +463,9 @@ static int _cmp_orderbook(const void *a,const void *b) #define ptr_a ((struct LP_orderbookentry *)a)->basesatoshis #define ptr_b ((struct LP_orderbookentry *)b)->basesatoshis if ( ptr_b > ptr_a ) - return(1); - else if ( ptr_b < ptr_a ) return(-1); + else if ( ptr_b < ptr_a ) + return(1); } // printf("%.8f vs %.8f -> %d\n",ptr_a,ptr_b,retval); return(retval); @@ -473,11 +473,6 @@ static int _cmp_orderbook(const void *a,const void *b) #undef ptr_b } -static int _cmp_orderbookrev(const void *a,const void *b) -{ - return(-_cmp_orderbook(a,b)); -} - cJSON *LP_orderbookjson(struct LP_orderbookentry *op) { cJSON *item = cJSON_CreateObject(); @@ -603,13 +598,13 @@ char *LP_orderbook(char *base,char *rel) retjson = cJSON_CreateObject(); array = cJSON_CreateArray(); if ( numbids > 1 ) - qsort(bids,numbids,sizeof(*bids),_cmp_orderbookrev); + qsort(bids,numbids,sizeof(*bids),_cmp_orderbook); if ( numasks > 1 ) { for (i=0; iprice); printf(" -> "); - qsort(asks,numasks,sizeof(*asks),_cmp_orderbookrev); + qsort(asks,numasks,sizeof(*asks),_cmp_orderbook); for (i=0; iprice); printf("sorted asks.%d\n",numasks);