add stake to gui
This commit is contained in:
@@ -2193,16 +2193,16 @@ CAmount CWallet::GetImmatureBalance() const
|
||||
return nTotal;
|
||||
}
|
||||
|
||||
CAmount CWallet::GetStakeBalance() const
|
||||
// ppcoin: total coins staked (non-spendable until maturity)
|
||||
CAmount CWallet::GetStake() const
|
||||
{
|
||||
CAmount nTotal = 0;
|
||||
LOCK2(cs_main, cs_wallet);
|
||||
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
|
||||
{
|
||||
LOCK2(cs_main, cs_wallet);
|
||||
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
|
||||
{
|
||||
const CWalletTx* pcoin = &(*it).second;
|
||||
nTotal += pcoin->GetImmatureStakeCredit();
|
||||
}
|
||||
const CWalletTx* pcoin = &(*it).second;
|
||||
if (pcoin->IsCoinStake() && pcoin->GetBlocksToMaturity() > 0 && pcoin->GetDepthInMainChain() > 0)
|
||||
nTotal += CWallet::GetCredit(*pcoin, ISMINE_SPENDABLE);
|
||||
}
|
||||
return nTotal;
|
||||
}
|
||||
@@ -2341,6 +2341,21 @@ static void ApproximateBestSubset(vector<pair<CAmount, pair<const CWalletTx*,uns
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
CAmount CWallet::GetWatchOnlyStake() const
|
||||
{
|
||||
CAmount nTotal = 0;
|
||||
LOCK2(cs_main, cs_wallet);
|
||||
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
|
||||
{
|
||||
const CWalletTx* pcoin = &(*it).second;
|
||||
if (pcoin->IsCoinStake() && pcoin->GetBlocksToMaturity() > 0 && pcoin->GetDepthInMainChain() > 0)
|
||||
nTotal += CWallet::GetCredit(*pcoin, ISMINE_WATCH_ONLY);
|
||||
}
|
||||
return nTotal;
|
||||
}
|
||||
|
||||
bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int nConfTheirs, vector<COutput> vCoins,
|
||||
set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, CAmount& nValueRet) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user