This commit is contained in:
jl777
2016-11-06 16:18:06 -03:00
parent fde4e779cf
commit ecc2479afa

View File

@@ -363,8 +363,7 @@ 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,zeroes,numvotes,wt,nonz; int64_t delta; uint64_t lastprice,seed,tolerance,den,densum,sum=0,votes[539];
return(_komodo_paxprice(height,base,rel,basevolume));
//return(_komodo_paxprice(height,base,rel,basevolume));
numvotes = (int32_t)(sizeof(Peggy_inds)/sizeof(*Peggy_inds));
memset(votes,0,sizeof(votes));
for (sum=i=zeroes=nonz=0; i<numvotes; i++)
@@ -375,7 +374,7 @@ uint64_t komodo_paxprice(int32_t height,char *base,char *rel,uint64_t basevolume
//printf("null price height.%d\n",height-i);
//return(0);
} else sum += votes[i], nonz++;
printf("%.8f, ",dstr(votes[i]));
//printf("%.8f, ",dstr(votes[i]));
}
if ( nonz <= (numvotes >> 1) )
return(0);
@@ -387,7 +386,7 @@ uint64_t komodo_paxprice(int32_t height,char *base,char *rel,uint64_t basevolume
votes[i] = lastprice;
else lastprice = votes[i];
}
printf("\n}; // numvotes.%d\n\n",numvotes);
//printf("\n}; // numvotes.%d\n\n",numvotes);
seed = komodo_seed(height);
tolerance = sum / 50;
for (k=0; k<numvotes; k++)
@@ -423,7 +422,7 @@ uint64_t komodo_paxprice(int32_t height,char *base,char *rel,uint64_t basevolume
}
sum /= densum;
sum = (sum * basevolume) / COIN;
//printf("seed.%llx sum %.8f densum %.8f basevol %.8f\n",(long long)seed,dstr(sum),dstr(densum),dstr(basevolume));
printf("seed.%llx sum %.8f densum %.8f basevol %.8f\n",(long long)seed,dstr(sum),dstr(densum),dstr(basevolume));
break;
}
}