aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-06-15 09:02:05 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2015-06-15 09:02:38 +0200
commitf3d4dbb93991f1904a5bff4cf000fce930cbb3c7 (patch)
tree32d6d140832c60ffdd9aead6db7e710cd665c212 /src
parent06818f7145cac51529b07f9cade5e16dabc22d29 (diff)
parent7d6a85ab5b1dc96e0f3f6f835f27bb81ba2af919 (diff)
downloadbitcoin-f3d4dbb93991f1904a5bff4cf000fce930cbb3c7.tar.xz
Merge pull request #6276
7d6a85a Fix getbalance * (Tom Harding)
Diffstat (limited to 'src')
-rw-r--r--src/wallet/rpcwallet.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index d284fcf15c..43fcc632f0 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -733,12 +733,12 @@ UniValue getbalance(const UniValue& 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 '*' 0 should return the same number
+ // getbalance and "getbalance * 1 true" should return the same number
CAmount nBalance = 0;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
- if (!wtx.IsTrusted() || wtx.GetBlocksToMaturity() > 0)
+ if (!CheckFinalTx(wtx) || wtx.GetBlocksToMaturity() > 0 || wtx.GetDepthInMainChain() < 0)
continue;
CAmount allFee;