diff --git a/iguana/exchanges/LP_privkey.c b/iguana/exchanges/LP_privkey.c index 632309a7a..c1c0bcd8b 100644 --- a/iguana/exchanges/LP_privkey.c +++ b/iguana/exchanges/LP_privkey.c @@ -443,7 +443,7 @@ void verus_utxos(struct iguana_info *coin,char *coinaddr) char *verusblocks() { - bits256 hash,txid; uint8_t script[44]; double value,stakedval,RTu3sum,powsum,supply,possum,histo[1280],myhisto[1280]; int32_t num2,num4,num8,num16,num32,num64,num17500,numpow,numpos,num,locked,height,i,m,n,z,posflag,npos,npow; char hashstr[64],firstaddr[64],stakingaddr[64],*addr0,*lastaddr,*hexstr; cJSON *blockjson,*txobj,*vouts,*vout,*vout1,*sobj,*addresses,*txs; + bits256 hash,txid; uint8_t script[44]; double value,avestakedsize,stakedval,RTu3sum,powsum,supply,possum,histo[1280],myhisto[1280]; int32_t num2,num4,num8,num16,num32,num64,num17500,numpow,numpos,num,locked,height,i,m,n,z,numstaked,posflag,npos,npow; char hashstr[64],firstaddr[64],stakingaddr[64],*addr0,*lastaddr,*hexstr; cJSON *blockjson,*txobj,*vouts,*vout,*vout1,*sobj,*addresses,*txs; struct iguana_info *coin = LP_coinfind("VRSC"); if ( coin == 0 ) return(clonestr("{\"error\":\"VRSC not active\"}")); @@ -454,8 +454,8 @@ char *verusblocks() hash = LP_getbestblockhash(coin); memset(histo,0,sizeof(histo)); memset(myhisto,0,sizeof(myhisto)); - num17500 = num16 = num32 = num64 = num2 = num4 = num8 = 0; - possum = powsum = supply = RTu3sum = 0.; + num17500 = num16 = num32 = num64 = num2 = num4 = num8 = numstaked = 0; + avestakedsize = possum = powsum = supply = RTu3sum = 0.; numpow = numpos = num = npos = npow = 0; if ( bits256_nonz(hash) != 0 ) { @@ -525,6 +525,8 @@ char *verusblocks() { strcpy(stakingaddr,lastaddr); stakedval = jdouble(vout,"value"); + avestakedsize += stakedval; + numstaked++; //printf("stakedval %f\n",stakedval); posflag = 1; //printf("ht.%d found staking address.(%s) %.8f (%s)\n",height,stakingaddr,stakedval,jprint(vout,0)); @@ -607,7 +609,7 @@ char *verusblocks() printf("mytimelocked\n"); } printf("num.%d PoW %.2f%% %.8f %d v %d PoS %.2f%% %.8f -> %.8f supply %.8f PoW %.1f%% PoS %.1f%% both %.1f%% RTu3sum %.8f %.1f%%\n",num,100.*(double)numpow/num,powsum,npow,npos,100.*(double)numpos/num,possum,powsum+possum,supply,100.*powsum/supply,100.*possum/supply,100.*(powsum+possum)/supply,RTu3sum,100.*RTu3sum/supply); - printf("num2.%d num4.%d num8.%d num16.%d / num17500.%d -> %.2f%% %.2f%% %.2f%% %.2f%% [%.3f %.3f %.3f %.3f] %.3f \n",num2,num4,num8,num16,num17500,100.*(double)num2/num17500,100.*(double)num4/num17500,100.*(double)num8/num17500,100.*(double)num16/num17500,(100.*(double)num2/num17500)/2.75,(100.*(double)num4/num17500)/2.75,(100.*(double)num8/num17500)/4.5,(100.*(double)num16/num17500)/14,(100.*(double)(num2+num4+num8+num16)/num17500)/24); + printf("num2.%d num4.%d num8.%d num16.%d / num17500.%d -> %.2f%% %.2f%% %.2f%% %.2f%% [%.3f %.3f %.3f %.3f] %.3f ave %.8f\n",num2,num4,num8,num16,num17500,100.*(double)num2/num17500,100.*(double)num4/num17500,100.*(double)num8/num17500,100.*(double)num16/num17500,(100.*(double)num2/num17500)/2.75,(100.*(double)num4/num17500)/2.75,(100.*(double)num8/num17500)/4.5,(100.*(double)num16/num17500)/14,(100.*(double)(num2+num4+num8+num16)/num17500)/24,avestakedsize/numstaked); } return(clonestr("{\"result\":\"success\"}")); }