When a wallet owns only some inputs of a transaction, such as in CoinJoins, payjoins, or other collaborative transactions, wallet history RPCs currently apply normal send accounting.
That works when all inputs are wallet-owned, but breaks for mixed-input transactions.
Example:
Inputs:
1.00 BTC wallet-owned
2.00 BTC foreign
Outputs:
0.80 BTC wallet-owned
2.19 BTC non-wallet
The wallet can safely know:
wallet_debit = 1.00
wallet_credit = 0.80
wallet_net = -0.20
But it cannot reliably know, from wallet history alone, the foreign input value, the total fee, the wallet's fee share, or which non-wallet output should be attributed as the user's payment. This is especially important after restore, rescan, or descriptor import, where any local transaction-intent metadata may be missing.
This PR adds a conservative fallback for that no-metadata case:
- classify wallet transactions as having no wallet inputs, partial wallet inputs, or all wallet inputs
- keep existing send/fee accounting when all inputs are wallet-owned
- also keep normal per-output send/fee accounting for mixed-input transactions when every non-wallet input has a known zero value
- otherwise report a single unattributed aggregate
sendentry with no address, novout, and no fee, carrying the negative total of wallet-owned inputs spent - report wallet-owned outputs as
receiveentries, so the transaction's entries sum to the wallet's net change - expose
involves_mixed_inputs,wallet_debit, andwallet_credit - document that
voutandfeeare optional when attribution is unavailable
This does not try to fully solve collaborative transaction attribution. A richer layer with foreign-output / fee-share / intent metadata would still be useful for wallet-created transactions. This PR only makes the fallback honest when that metadata is unavailable.
Addresses #14136