From 9fd7459c47212accecc177e9c88746820334cf13 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 6 Nov 2016 15:01:58 -0300 Subject: [PATCH] test --- src/komodo_pax.h | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/komodo_pax.h b/src/komodo_pax.h index 00e6fde97..7f76ec351 100644 --- a/src/komodo_pax.h +++ b/src/komodo_pax.h @@ -352,24 +352,33 @@ uint64_t _komodo_paxprice(int32_t height,char *base,char *rel,uint64_t basevolum uint64_t komodo_paxprice(int32_t height,char *base,char *rel,uint64_t basevolume) { - int32_t i,j,k,ind,numvotes,wt; int64_t delta; uint64_t seed,tolerance,den,densum,sum=0,votes[539]; + int32_t i,j,k,ind,zeroes,numvotes,wt,nonz; int64_t delta; uint64_t lastprice,seed,tolerance,den,densum,sum=0,votes[539]; numvotes = (int32_t)(sizeof(Peggy_inds)/sizeof(*Peggy_inds)); memset(votes,0,sizeof(votes)); - for (sum=i=0; i> 1) ) + return(0); + sum /= nonz; + lastprice = sum; + for (i=0; i