Changes getbalances to report the sum of txos spent by transactions that aren’t confirmed nor in the mempool (eg due to being part of too long a mempool chain, or spending non-standard outputs, or having a datacarrier output that exceeds -datacarriersize, etc). Those values are added to the trusted/untrusted_pending/immature/used fields as appropriate (where previously they were skipped), and subtracted from the new nonmempool field, so that the sum of all fields remains the same.
For example:
0$ bitcoin-cli -regtest getbalances
1{
2 "mine": {
3 "trusted": 6049.99999220,
4 "untrusted_pending": 0.00000000,
5 "immature": 3200.00000780,
6 "nonmempool": -100.00000000
7 },
8 "lastprocessedblock": {
9 "hash": "3ab4582226d5e8ad76438db48d76e822c31bce2cdbc7ba82a5d974a277515d0d",
10 "height": 221
11 }
12}
Closes #11887