c2da52d366 wallet: allow importprunedfunds for spending transactions (8144225309)
Pull request description:
`importprunedfunds` only allowed importing transactions that credit the wallet
(checked via `IsMine`), rejecting transactions that spend from it. This could
leave a pruned wallet showing an incorrect balance: if a spending transaction
was removed with `removeprunedfunds`, it couldn't be re-imported and would fail
with "No addresses in wallet correspond to included transaction".
This routes the import through `AddToWalletIfInvolvingMe()`, which already
checks both `IsMine()` and `IsFromMe()`, so spending transactions are accepted
and the involvement check is no longer duplicated in `importprunedfunds`. A
functional test imports a transaction that spends from the wallet but has no
outputs to it (entire UTXO sent externally).
Fixes#21647
ACKs for top commit:
achow101:
ACK c2da52d366
Bicaru20:
re-ACK c2da52d366
Tree-SHA512: 0ece38c75d3608948f1c29c5fca29b6420197b0a153e361decf232fd27edd5dd1f2e5d6f9625eee6f7691abd9992f95ef89c904d486ee927d03c88475e479b9c