From d1373b57010a893feaca035d24a6cc209da1cf97 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 27 Jun 2017 13:47:34 +0300 Subject: [PATCH] Test --- src/komodo_pax.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/komodo_pax.h b/src/komodo_pax.h index 7d696d4c7..4910179c8 100644 --- a/src/komodo_pax.h +++ b/src/komodo_pax.h @@ -352,7 +352,10 @@ uint64_t komodo_paxcorrelation(uint64_t *votes,int32_t numvotes,uint64_t seed) else sum += votes[i], nonz++; } if ( nonz < (numvotes >> 2) ) + { + printf("komodo_paxcorrelation not enough votes: nonz.%d numvotes.%d\n",nonz,numvotes); return(0); + } sum /= nonz; lastprice = sum; for (i=0; i (numvotes >> 1) ) - break; - } + if ( delta <= tolerance ) + { + wt++; + if ( wt > (numvotes >> 1) ) + break; + } } } } @@ -397,9 +400,9 @@ uint64_t komodo_paxcorrelation(uint64_t *votes,int32_t numvotes,uint64_t seed) if ( densum != 0 ) sum /= densum; //sum = (sum * basevolume); - //printf("paxprice seed.%llx sum %.8f densum %.8f\n",(long long)seed,dstr(sum),dstr(densum)); +printf("paxprice seed.%llx sum %.8f densum %.8f\n",(long long)seed,dstr(sum),dstr(densum)); break; - } + } else printf("correlation k.%d not enough wt: wt.%d vs numvotes.%d\n",k,wt,numvotes); } return(sum); } @@ -552,7 +555,7 @@ uint64_t _komodo_paxpriceB(uint64_t seed,int32_t height,char *base,char *rel,uin for (i=0; i