aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-02-04 14:04:26 -0500
committerGavin Andresen <gavinandresen@gmail.com>2013-02-04 14:04:26 -0500
commitd28bd8b7ca2d0d9ad5f01e005b49acdd3a9eb917 (patch)
tree1aa2096839505192c878fbd83377a9c778f0cbf9 /src/wallet.cpp
parent77052ab0f396507527d9b9063561fea92360c97d (diff)
Fix getbalance discrepency
Two changes: Use IsConfirmed() instead of IsFinal(), so 'getbalance "*" 0' uses the same 'is this output spendable' criteria as 'getbalance'. Fixes issue #172. And a tiny refactor to CWallet::GetBalance() (redundant call to IsFinal -- IsConfirmed calls IsFinal). getbalance with no arguments and 'getbalance "*" 0' could return different different results,
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r--src/wallet.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index b8ef2a20bf..d3345cd870 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -899,7 +899,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();
}
}