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
std::set<CInputCoin> setPresetCoins;
    std::vector<COutPoint> vPresetInputs;
    coin_control.ListSelected(vPresetInputs);
    for (const COutPoint& outpoint : vPresetInputs) {
        int input_bytes = -1;
        CTxOut txout;
        std::map<uint256, CWalletTx>::const_iterator it = wallet.mapWallet.find(outpoint.hash);
        if (it != wallet.mapWallet.end()) {
            const CWalletTx& wtx = it->second;
            
            if (wtx.tx->vout.size() <= outpoint.n) {
                return std::nullopt;
            }
            input_bytes = GetTxSpendSize(wallet, wtx, outpoint.n, false);
            txout = wtx.tx->vout.at(outpoint.n);
        }
        if (input_bytes == -1) {
            
            if (!coin_control.GetExternalOutput(outpoint, txout)) {
                
                return std::nullopt;
            }
            input_bytes = CalculateMaximumSignedInputSize(txout, &coin_control.m_external_provider,  true);
        }
        CInputCoin coin(outpoint, txout, input_bytes);
        if (coin.m_input_bytes == -1) {
            return std::nullopt; 
        }
        coin.effective_value = coin.txout.nValue - coin_selection_params.m_effective_feerate.GetFee(coin.m_input_bytes);
        if (coin_selection_params.m_subtract_fee_outputs) {