Currently, if the wallet generates a transaction that cannot currently go into the mempool (e.g. due to too-long-mempool-chain), the wallet UTXOs related to this will vanish from getbalance
, giving the appearance that the user has less funds than they actually do.
From a “get spendable balance” perspective, this is perfectly valid, but users may sometimes want to see their actual balance, regardless of whether they can spend it or not at that time.
This PR adds an include_unspendable
option (default=false) to getbalance
which, when true
, will consider non-mempool transactions as trusted, and thus display these in the tally.
Note: this flag does nothing when a user specifies an account (i.e. GetLegacyBalance
), and the legacy balance in fact already does what include_unspendable=true
does, given the right arguments.