Get staking parameters from chainparams.cpp

nStakeTimestampMask, nStakeMinConfirmations, nStakeMinAge
This commit is contained in:
lateminer
2017-12-04 23:43:49 +03:00
parent 213fa374d1
commit af6e26a288
8 changed files with 14 additions and 16 deletions

View File

@@ -580,7 +580,7 @@ void CWallet::AvailableCoinsForStaking(std::vector<COutput>& vCoins) const
if (nDepth < 1)
continue;
if (nDepth < nStakeMinConfirmations)
if (nDepth < Params().GetConsensus().nStakeMinConfirmations)
continue;
if (pcoin->GetBlocksToMaturity() > 0)
@@ -654,7 +654,7 @@ bool CheckKernel(CBlockIndex* pindexPrev, unsigned int nBits, int64_t nTime, con
return false;
int nDepth;
if (IsConfirmedInNPrevBlocks(txindex, pindexPrev, nStakeMinConfirmations - 1, nDepth))
if (IsConfirmedInNPrevBlocks(txindex, pindexPrev, Params().GetConsensus().nStakeMinConfirmations - 1, nDepth))
return false;
if (pBlockTime)
@@ -3315,7 +3315,7 @@ uint64_t CWallet::GetStakeWeight() const
LOCK2(cs_main, cs_wallet);
BOOST_FOREACH(PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins)
{
if (pcoin.first->GetDepthInMainChain() >= nStakeMinConfirmations)
if (pcoin.first->GetDepthInMainChain() >= Params().GetConsensus().nStakeMinConfirmations)
nWeight += pcoin.first->vout[pcoin.second].nValue;
}