From 5d2c41f9d678971c9b6fff9de6348a56d925720a Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 30 Jul 2013 02:20:31 +0400 Subject: [PATCH 1/1] Fix getbalance --- src/rpcwallet.cpp | 4 ++-- src/wallet.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index acd7944..3a1c2b9 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -553,12 +553,12 @@ Value getbalance(const Array& params, bool fHelp) if (params[0].get_str() == "*") { // Calculate total balance a different way from GetBalance() // (GetBalance() sums up all unspent TxOuts) - // getbalance and getbalance '*' should always return the same number. + // getbalance and getbalance '*' 0 should return the same number. int64 nBalance = 0; for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) { const CWalletTx& wtx = (*it).second; - if (!wtx.IsFinal()) + if (!wtx.IsConfirmed()) continue; int64 allGeneratedImmature, allGeneratedMature, allFee; diff --git a/src/wallet.cpp b/src/wallet.cpp index 64e3318..9988577 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -975,7 +975,7 @@ int64 CWallet::GetBalance() const for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx* pcoin = &(*it).second; - if (pcoin->IsFinal() && pcoin->IsConfirmed()) + if (pcoin->IsConfirmed()) nTotal += pcoin->GetAvailableCredit(); } } -- 1.7.1