Add call to request unconfirmed balance
This commit is contained in:
parent
fa989f42c1
commit
a35ee96336
2 changed files with 16 additions and 0 deletions
|
@ -570,6 +570,21 @@ int64 CWallet::GetBalance() const
|
|||
return nTotal;
|
||||
}
|
||||
|
||||
int64 CWallet::GetUnconfirmedBalance() const
|
||||
{
|
||||
int64 nTotal = 0;
|
||||
CRITICAL_BLOCK(cs_mapWallet)
|
||||
{
|
||||
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
|
||||
{
|
||||
const CWalletTx* pcoin = &(*it).second;
|
||||
if (pcoin->IsFinal() && pcoin->IsConfirmed())
|
||||
continue;
|
||||
nTotal += pcoin->GetAvailableCredit();
|
||||
}
|
||||
}
|
||||
return nTotal;
|
||||
}
|
||||
|
||||
bool CWallet::SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfTheirs, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const
|
||||
{
|
||||
|
|
|
@ -57,6 +57,7 @@ public:
|
|||
void ReacceptWalletTransactions();
|
||||
void ResendWalletTransactions();
|
||||
int64 GetBalance() const;
|
||||
int64 GetUnconfirmedBalance() const;
|
||||
bool CreateTransaction(const std::vector<std::pair<CScript, int64> >& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet);
|
||||
bool CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet);
|
||||
bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey);
|
||||
|
|
Loading…
Reference in a new issue