This would allow wallet operations like funding transactions with smart contract-based inputs such as LN, or any input the Core wallet doesn't know how to sign for.

https://github.com/bitcoin/bitcoin/pull/17211#issuecomment-933674310
{
    AssertLockHeld(wallet.cs_wallet);
    std::map<CTxDestination, std::vector<COutput>> result;
    std::vector<COutput> availableCoins;
    AvailableCoins(wallet, availableCoins);
    for (const COutput& coin : availableCoins) {
        CTxDestination address;
        if ((coin.fSpendable || (wallet.IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS) && coin.fSolvable)) &&
            ExtractDestination(FindNonChangeParentOutput(wallet, *coin.tx->tx, coin.i).scriptPubKey, address)) {
            result[address].emplace_back(std::move(coin));
        }
    }
    std::vector<COutPoint> lockedCoins;
    wallet.ListLockedCoins(lockedCoins);