Currently, listtransactions silently hides transactions whose outputs go exclusively to change addresses. This can be confusing, as reported in #34632: a user created a consolidation transaction sending funds to a change address, and the transaction disappeared from listtransactions, making it appear as though funds were lost.
listsinceblock already supports an include_change parameter for this purpose. The internal ListTransactions helper also already accepts it. This PR simply wires the parameter through the listtransactions RPC handler for consistency.
- Adds
include_change(bool, defaultfalse) as a new argument after the existinginclude_watchonly - No behavior change for existing callers
- Includes functional test coverage
This approach was suggested by @mossein in #34632. A more comprehensive listrawtransactions RPC as mentioned by @achow101 could be pursued separately.
Fixes #34632