Add a “total” field in RPC getbalances to be able to easily see the total amount held in the wallet, and use that field for the wallet balances in CLI -getinfo.
Currently -getinfo only returns getbalances#mine.trusted for wallet balances. It would make sense to instead return the total balance. For instance, to see:
- watchonly balances
- reused outputs, like coins returned to a wallet from an exchange or third party service that uses a fixed (reused) address, whether
avoid_reuse
is set or not, as it can be scary for a user not to see the received coins in the -getinfo summary
We can keep getbalances#total simple and clear by returning the total of all the getbalances fields. If the -getinfo wallet balances use the total as-is, they would include immature coinbase rewards and unconfirmed transactions, which seems ok to me to see what is coming. Alternatively, depending on review feedback, -getinfo could show e.g. only trusted, used, and watchonly balances without immature coinbase rewards and unconfirmed transactions.