|
|
@ -259,12 +259,13 @@ struct LP_cacheinfo *LP_cacheadd(char *base,char *rel,bits256 txid,int32_t vout, |
|
|
|
|
|
|
|
static int _cmp_orderbook(const void *a,const void *b) |
|
|
|
{ |
|
|
|
int32_t retval = 0; |
|
|
|
#define ptr_a ((struct LP_cacheinfo *)a)->price |
|
|
|
#define ptr_b ((struct LP_cacheinfo *)b)->price |
|
|
|
if ( ptr_b > ptr_a ) |
|
|
|
return(1); |
|
|
|
retval = 1; |
|
|
|
else if ( ptr_b < ptr_a ) |
|
|
|
return(-1); |
|
|
|
retval = -1; |
|
|
|
/* else
|
|
|
|
{ |
|
|
|
#undef ptr_a |
|
|
@ -276,7 +277,8 @@ static int _cmp_orderbook(const void *a,const void *b) |
|
|
|
else if ( ptr_b < ptr_a ) |
|
|
|
return(-1); |
|
|
|
}*/ |
|
|
|
return(0); |
|
|
|
printf("%.8f vs %.8f -> %d\n",ptr_a,ptr_b,retval); |
|
|
|
return(retval); |
|
|
|
#undef ptr_a |
|
|
|
#undef ptr_b |
|
|
|
} |
|
|
|