From 2e2244a2aa7ed60fdfc05ebf6144b6bd6cdd625f Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Jul 2018 06:52:48 -1100 Subject: [PATCH] Test --- src/cc/rewards.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/rewards.cpp b/src/cc/rewards.cpp index 1f3ec6702..a40041289 100644 --- a/src/cc/rewards.cpp +++ b/src/cc/rewards.cpp @@ -43,11 +43,11 @@ uint64_t RewardsCalc(uint64_t amount,uint256 txid,uint64_t APR,uint64_t minsecon if ( (duration= CCduration(txid)) < minseconds ) { //return(0); - duration = 3600 * 24; + duration = (uint32_t)time(NULL) - (1532713903 - 3600 * 24); } else if ( duration > maxseconds ) maxseconds = duration; - reward = (((amount * APR) / COIN) * duration) / 100; + reward = (((amount * APR) / 365*24*3600) * duration) / (COIN * 100); fprintf(stderr,"amount %.8f %.8f %llu -> duration.%llu reward %.8f\n",(double)amount/COIN,((double)amount * APR)/COIN,(long long)((amount * APR) / (COIN * 365*24*3600)),(long long)duration,(double)reward/COIN); return(reward); }