Skip to content

Commit

Permalink
Fix getbalance
Browse files Browse the repository at this point in the history
First of many.
  • Loading branch information
Tranz5 committed May 21, 2014
1 parent 3747989 commit b6f052b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint256, CWalletTx>::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;
Expand Down
2 changes: 1 addition & 1 deletion src/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ int64 CWallet::GetBalance() const
for (map<uint256, CWalletTx>::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();
}
}
Expand Down

0 comments on commit b6f052b

Please sign in to comment.