Skip to content

Commit

Permalink
disable max age
Browse files Browse the repository at this point in the history
  • Loading branch information
PXLFuSSeL committed May 14, 2018
1 parent 5c0be6e commit 32b9772
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/kernel.cpp
Expand Up @@ -213,8 +213,8 @@ bool CheckStakeKernelHash(CBlockIndex* pindexPrev, unsigned int nBits, unsigned

if (nTimeBlockFrom + nStakeMinAge > nTimeTx) // Min age requirement
return error("CheckStakeKernelHash() : min age violation");
if (nTimeBlockFrom + nStakeMaxAge < nTimeTx) // Max age requirement
return error("CheckStakeKernelHash() : max age violation");
//if (nTimeBlockFrom + nStakeMaxAge < nTimeTx) // Max age requirement
//return error("CheckStakeKernelHash() : max age violation");



Expand Down Expand Up @@ -327,7 +327,7 @@ bool CheckKernel(CBlockIndex* pindexPrev, unsigned int nBits, int64_t nTime, con
if (!block.ReadFromDisk(txindex.pos.nFile, txindex.pos.nBlockPos, false))
return false;

if ((block.GetBlockTime() + nStakeMinAge > nTime) || (block.GetBlockTime() + nStakeMaxAge < nTime))
if ((block.GetBlockTime() + nStakeMinAge > nTime))// || (block.GetBlockTime() + nStakeMaxAge < nTime))
return false; // only count coins meeting min age requirement

int nDepth;
Expand Down
8 changes: 4 additions & 4 deletions src/wallet.cpp
Expand Up @@ -1748,8 +1748,8 @@ void CWallet::AvailableCoinsForStaking(vector<COutput>& vCoins, unsigned int nSp
if (pcoin->nTime + nStakeMinAge > nSpendTime)
continue;
// Filtering by tx timestamp instead of block timestamp may give false positives but never false negatives
if (pcoin->nTime + nStakeMaxAge < nSpendTime)
continue;
//if (pcoin->nTime + nStakeMaxAge < nSpendTime)
// continue;
}

if (pcoin->GetBlocksToMaturity() > 0)
Expand Down Expand Up @@ -3494,8 +3494,8 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int
if (nTimeWeight < nStakeMinAge)
continue;
// Do not add input that is too old
if (nTimeWeight > nStakeMaxAge)
continue;
//if (nTimeWeight > nStakeMaxAge)
// continue;

txNew.vin.push_back(CTxIn(pcoin.first->GetHash(), pcoin.second));
nCredit += pcoin.first->vout[pcoin.second].nValue;
Expand Down

0 comments on commit 32b9772

Please sign in to comment.