Skip to content

Commit f3d4dbb

Browse files
committed
Merge pull request #6276
7d6a85a Fix getbalance * (Tom Harding)
2 parents 06818f7 + 7d6a85a commit f3d4dbb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wallet/rpcwallet.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -733,12 +733,12 @@ UniValue getbalance(const UniValue& params, bool fHelp)
733733
if (params[0].get_str() == "*") {
734734
// Calculate total balance a different way from GetBalance()
735735
// (GetBalance() sums up all unspent TxOuts)
736-
// getbalance and getbalance '*' 0 should return the same number
736+
// getbalance and "getbalance * 1 true" should return the same number
737737
CAmount nBalance = 0;
738738
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
739739
{
740740
const CWalletTx& wtx = (*it).second;
741-
if (!wtx.IsTrusted() || wtx.GetBlocksToMaturity() > 0)
741+
if (!CheckFinalTx(wtx) || wtx.GetBlocksToMaturity() > 0 || wtx.GetDepthInMainChain() < 0)
742742
continue;
743743

744744
CAmount allFee;

0 commit comments

Comments
 (0)