CWallet::GetImmatureBalance()
with CWallet::GetBalance()
and CWallet::GetUnconfirmedBalance()
.
CWallet::GetImmatureBalance()
with CWallet::GetBalance()
and CWallet::GetUnconfirmedBalance()
.
Guys, I setup bitcoind and can use it to pass RPC commands, but I simply don’t know how you want me to test the function there, as GetImmatureBalance()
seems to be only used by Qt?
I could for sure add obj.push_back(Pair("walletversion", pwalletMain->GetImmatureBalance()));
to RPC getinfo
, but as I can’t compile bitcoind I would rely on @BitcoinPullTester to create a bitcoind.exe for me and need to revert that change before this would be considered mergeable.
925@@ -926,9 +926,8 @@ int64 CWallet::GetImmatureBalance() const
926 LOCK(cs_wallet);
927 for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
928 {
929- const CWalletTx& pcoin = (*it).second;
930- if (pcoin.IsCoinBase() && pcoin.GetBlocksToMaturity() > 0 && pcoin.IsInMainChain())
931- nTotal += GetCredit(pcoin);
932+ const CWalletTx* pcoin = &(*it).second;
&(*it).second;
is slightly more ugly code, and in C++ it’s generally advised to use references instead of pointers where possible (for type safety etc).
566@@ -563,6 +567,20 @@ class CWalletTx : public CMerkleTx
567 return nCreditCached;
568 }
569
570+ int64 GetImmatureCredit(bool fUseCache=true) const
571+ {