Proof-of-stake related code refactoring and cleanup

This commit is contained in:
lateminer
2018-10-12 23:40:50 +03:00
parent da2c4ec6c9
commit 66dd63a23b
10 changed files with 163 additions and 164 deletions

View File

@@ -607,8 +607,8 @@ void CWallet::AvailableCoinsForStaking(std::vector<COutput>& vCoins) const
if (nDepth < 1)
continue;
if (nDepth < Params().GetConsensus().nStakeMinConfirmations)
continue;
if (nDepth < Params().GetConsensus().nStakeMinConfirmations)
continue;
if (pcoin->GetBlocksToMaturity() > 0)
continue;
@@ -626,6 +626,13 @@ void CWallet::AvailableCoinsForStaking(std::vector<COutput>& vCoins) const
}
}
bool CWallet::HaveAvailableCoinsForStaking() const
{
vector<COutput> vCoins;
AvailableCoinsForStaking(vCoins);
return vCoins.size() > 0;
}
// Select some coins without random shuffle or best subset approximation
bool CWallet::SelectCoinsForStaking(CAmount& nTargetValue, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, CAmount& nValueRet) const
{