This commit is contained in:
jl777
2016-10-24 06:33:57 -03:00
parent 3505af19f8
commit ef7a354895
2 changed files with 5 additions and 5 deletions

View File

@@ -471,7 +471,7 @@ void komodo_pvals(int32_t height,uint32_t *pvals,uint8_t numpvals)
{ {
if ( pvals[i] != 0 ) if ( pvals[i] != 0 )
nonz++; nonz++;
printf("%u ",pvals[i]); //printf("%u ",pvals[i]);
} }
if ( nonz == 32 ) if ( nonz == 32 )
{ {
@@ -485,7 +485,7 @@ void komodo_pvals(int32_t height,uint32_t *pvals,uint8_t numpvals)
PVALS[36 * NUM_PRICES] = height; PVALS[36 * NUM_PRICES] = height;
memcpy(&PVALS[36 * NUM_PRICES + 1],pvals,sizeof(*pvals) * 35); memcpy(&PVALS[36 * NUM_PRICES + 1],pvals,sizeof(*pvals) * 35);
NUM_PRICES++; NUM_PRICES++;
printf("OP_RETURN.%d KMD %.8f BTC %.6f CNY %.6f NUM_PRICES.%d\n",height,KMDBTC,BTCUSD,CNYUSD,NUM_PRICES); //printf("OP_RETURN.%d KMD %.8f BTC %.6f CNY %.6f NUM_PRICES.%d\n",height,KMDBTC,BTCUSD,CNYUSD,NUM_PRICES);
} }
} }
} }
@@ -660,7 +660,7 @@ int32_t komodo_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numno
if ( fwrite(pvals,sizeof(uint32_t),numpvals,fp) != numpvals ) if ( fwrite(pvals,sizeof(uint32_t),numpvals,fp) != numpvals )
errs++; errs++;
komodo_pvals(height,pvals,numpvals); komodo_pvals(height,pvals,numpvals);
printf("save pvals height.%d numpvals.%d\n",height,numpvals); //printf("save pvals height.%d numpvals.%d\n",height,numpvals);
} }
else if ( height != 0 ) else if ( height != 0 )
{ {
@@ -769,7 +769,7 @@ int32_t komodo_voutupdate(int32_t notaryid,uint8_t *scriptbuf,int32_t scriptlen,
double KMDBTC,BTCUSD,CNYUSD; uint32_t numpvals,timestamp,pvals[128]; double KMDBTC,BTCUSD,CNYUSD; uint32_t numpvals,timestamp,pvals[128];
numpvals = dpow_readprices(&scriptbuf[++len],&timestamp,&KMDBTC,&BTCUSD,&CNYUSD,pvals); numpvals = dpow_readprices(&scriptbuf[++len],&timestamp,&KMDBTC,&BTCUSD,&CNYUSD,pvals);
komodo_stateupdate(height,0,0,0,zero,0,0,pvals,numpvals); komodo_stateupdate(height,0,0,0,zero,0,0,pvals,numpvals);
printf("vout OP_RETURN.%d prices numpvals.%d opretlen.%d\n",height,numpvals,opretlen); //printf("vout OP_RETURN.%d prices numpvals.%d opretlen.%d\n",height,numpvals,opretlen);
} }
} }
return(notaryid); return(notaryid);

View File

@@ -55,7 +55,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
if ( denominator == 0 ) if ( denominator == 0 )
denominator = 1; // max KOMODO_INTEREST per transfer, do it at least annually! denominator = 1; // max KOMODO_INTEREST per transfer, do it at least annually!
interest = (numerator / denominator) / COIN; interest = (numerator / denominator) / COIN;
fprintf(stderr,"komodo_interest %lld %.8f nLockTime.%u tiptime.%u minutes.%d interest %lld %.8f (%llu / %llu)\n",(long long)nValue,dstr(nValue),nLockTime,tiptime,minutes,(long long)interest,dstr(interest),(long long)numerator,(long long)denominator); //fprintf(stderr,"komodo_interest %lld %.8f nLockTime.%u tiptime.%u minutes.%d interest %lld %.8f (%llu / %llu)\n",(long long)nValue,dstr(nValue),nLockTime,tiptime,minutes,(long long)interest,dstr(interest),(long long)numerator,(long long)denominator);
} }
} }
return(interest); return(interest);