From bba30a43a5998b1e9aa9211136a097b008c8d905 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Jan 2017 14:05:01 +0200 Subject: [PATCH] test --- src/komodo_pax.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/komodo_pax.h b/src/komodo_pax.h index b2ac8cad0..700546453 100644 --- a/src/komodo_pax.h +++ b/src/komodo_pax.h @@ -429,7 +429,7 @@ uint64_t _komodo_paxprice(uint64_t *kmdbtcp,uint64_t *btcusdp,int32_t height,cha height -= 10; if ( (baseid= komodo_baseid(base)) >= 0 && (relid= komodo_baseid(rel)) >= 0 ) { - portable_mutex_lock(&komodo_mutex); + //portable_mutex_lock(&komodo_mutex); for (i=NUM_PRICES-1; i>=0; i--) { ptr = &PVALS[36 * i]; @@ -440,13 +440,13 @@ uint64_t _komodo_paxprice(uint64_t *kmdbtcp,uint64_t *btcusdp,int32_t height,cha *kmdbtcp = ptr[MAX_CURRENCIES + 1] / 539; *btcusdp = ptr[MAX_CURRENCIES + 2] / 539; } - portable_mutex_unlock(&komodo_mutex); + //portable_mutex_unlock(&komodo_mutex); if ( kmdbtc != 0 && btcusd != 0 ) return(komodo_paxcalc(&ptr[1],baseid,relid,basevolume,kmdbtc,btcusd)); else return(0); } } - portable_mutex_unlock(&komodo_mutex); + //portable_mutex_unlock(&komodo_mutex); } //else printf("paxprice invalid base.%s %d, rel.%s %d\n",base,baseid,rel,relid); return(0); } @@ -494,7 +494,8 @@ uint64_t komodo_paxpriceB(uint64_t *seedp,int32_t height,char *base,char *rel,ui uint64_t komodo_paxprice(uint64_t *seedp,int32_t height,char *base,char *rel,uint64_t basevolume) { int32_t i,nonz=0; uint64_t price,seed,sum = 0; - for (i=0; i<16; i++) + portable_mutex_lock(&komodo_mutex); + for (i=0; i<64; i++) { if ( (price= komodo_paxpriceB(&seed,height-i,base,rel,basevolume)) != 0 ) { @@ -504,6 +505,7 @@ uint64_t komodo_paxprice(uint64_t *seedp,int32_t height,char *base,char *rel,uin if ( height < 1500 ) // set to future height break; } + portable_mutex_unlock(&komodo_mutex); if ( nonz != 0 ) sum /= nonz; return(sum);