if (nTime > nNow + 10*60) // came in a flying DeLorean
return true;
- if (nTime==0 || nNow-nTime > ADDRMAN_HORIZON_DAYS*86400) // not seen in over a month
+ if (nTime==0 || nNow-nTime > ADDRMAN_HORIZON_DAYS*nOneDay) // not seen in over a month
return true;
if (nLastSuccess==0 && nAttempts>=ADDRMAN_RETRIES) // tried three times and never a success
return true;
- if (nNow-nLastSuccess > ADDRMAN_MIN_FAIL_DAYS*86400 && nAttempts>=ADDRMAN_MAX_FAILURES) // 10 successive failures in the last week
+ if (nNow-nLastSuccess > ADDRMAN_MIN_FAIL_DAYS*nOneDay && nAttempts>=ADDRMAN_MAX_FAILURES) // 10 successive failures in the last week
return true;
return false;
CTxDestination address;
std::string addrStr;
- uint64_t coinAge = max( (txOut.nValue * nDayWeight) / (COIN * 86400), (int64_t)0);
+ uint64_t coinAge = max( (txOut.nValue * nDayWeight) / (COIN * nOneDay), 0LL);
if (ExtractDestination(txOut.scriptPubKey, address))
{
int64_t KernelRecord::getAge() const
{
- return (GetAdjustedTime() - nTime) / 86400;
+ return (GetAdjustedTime() - nTime) / nOneDay;
}
uint64_t KernelRecord::getCoinDay() const
if( nWeight < 0)
return 0;
nWeight = min(nWeight, (int64_t)nStakeMaxAge);
- uint64_t coinAge = (nValue * nWeight ) / (COIN * 86400);
+ uint64_t coinAge = (nValue * nWeight ) / (COIN * nOneDay);
return coinAge;
}
int64_t nWeight = GetAdjustedTime() - nTime + minutes * 60;
if( nWeight < nStakeMinAge)
return 0;
- uint64_t coinAge = (nValue * nWeight ) / (COIN * 86400);
+ uint64_t coinAge = (nValue * nWeight ) / (COIN * nOneDay);
PoSReward = GetProofOfStakeReward(coinAge, nBits, GetAdjustedTime() + minutes * 60);
return PoSReward;
}
//uint64_t coinAge = max(nValue * dayWeight / COIN, (int64_t)0);
//return target * coinAge / pow(static_cast<double>(2), 256);
int64_t Weight = (min((GetAdjustedTime() - nTime) + timeOffset, (int64_t)(nStakeMinAge+nStakeMaxAge)) - nStakeMinAge);
- uint64_t coinAge = max(nValue * Weight / (COIN * 86400), (int64_t)0);
+ uint64_t coinAge = max(nValue * Weight / (COIN * nOneDay), 0LL);
return coinAge / (pow(static_cast<double>(2),32) * difficulty);
}
// Probabilities for the first d days
for(i = 0; i < d; i++)
{
- timeOffset = i * 86400;
- p = pow(1 - getProbToMintStake(difficulty, timeOffset), 86400);
+ timeOffset = i * nOneDay;
+ p = pow(1 - getProbToMintStake(difficulty, timeOffset), nOneDay);
prob *= p;
}
// Probability for the m minutes of the last day
- timeOffset = d * 86400;
+ timeOffset = d * nOneDay;
p = pow(1 - getProbToMintStake(difficulty, timeOffset), 60 * m);
prob *= p;