-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
Description
getbalance and getbalance '*' can return different amounts for 0-confirmation transactions, because of the way change transactions are counted. The discrepancy resolves as soon as the transaction is accepted into a block.
Details: CWalletTx::IsConfirmed() returns false for at least some 0-confirmation transactions loaded from a wallet, because they are missing vtxPrev (supporting transactions). That causes the issue, because getbalance (and the send methods) only count outputs of confirmed transactions as available, but GetAmounts (used by getbalance '*') assumes that change TxOuts are always available to be spent.