test
This commit is contained in:
@@ -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)
|
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];
|
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));
|
numvotes = (int32_t)(sizeof(Peggy_inds)/sizeof(*Peggy_inds));
|
||||||
memset(votes,0,sizeof(votes));
|
memset(votes,0,sizeof(votes));
|
||||||
for (sum=i=zeroes=nonz=0; i<numvotes; i++)
|
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);
|
//printf("null price height.%d\n",height-i);
|
||||||
//return(0);
|
//return(0);
|
||||||
} else sum += votes[i], nonz++;
|
} else sum += votes[i], nonz++;
|
||||||
printf("%.8f, ",dstr(votes[i]));
|
//printf("%.8f, ",dstr(votes[i]));
|
||||||
}
|
}
|
||||||
if ( nonz <= (numvotes >> 1) )
|
if ( nonz <= (numvotes >> 1) )
|
||||||
return(0);
|
return(0);
|
||||||
@@ -387,7 +386,7 @@ uint64_t komodo_paxprice(int32_t height,char *base,char *rel,uint64_t basevolume
|
|||||||
votes[i] = lastprice;
|
votes[i] = lastprice;
|
||||||
else lastprice = votes[i];
|
else lastprice = votes[i];
|
||||||
}
|
}
|
||||||
printf("\n}; // numvotes.%d\n\n",numvotes);
|
//printf("\n}; // numvotes.%d\n\n",numvotes);
|
||||||
seed = komodo_seed(height);
|
seed = komodo_seed(height);
|
||||||
tolerance = sum / 50;
|
tolerance = sum / 50;
|
||||||
for (k=0; k<numvotes; k++)
|
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 /= densum;
|
||||||
sum = (sum * basevolume) / COIN;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user