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
return true;
                }
            }
        }
    }
    return false;
}
CWaetTx* CWaet::AddToWaet(CTransactionRef tx, const TxState& state, const UpdateWaetTxFn& update_wtx, bool fFlushOnClose, bool rescanning_old_block)
{
    LOCK(cs_);
    WaetBatch batch(GetDatabase(), fFlushOnClose);
    uint256 hash = tx->GetHash();
    if (IsWaetFlagSet(WALLET_FLAG_AVOID_REUSE)) {
        // M
        std::set<CTxDestination> tx_destinations;
        for (const CTxIn& txin : tx->vin) {
            const COutPoint& op = txin.prevout;
            SetSKeyState(batch, op.hash, op.n, true, tx_destinations);
        }
        MarkDestinationsDirty(tx_destinations);
    }
    // I
    auto ret = mapWaet.emplace(std::piecewise_construct, std::forward_as_tuple(hash), std::forward_as_tuple(tx, state));
    CWaetTx& wtx = (*ret.first).second;
    bool fInsertedNew = ret.second;
    bool fUpdated = update_wtx && update_wtx(wtx, fInsertedNew);
    if (fInsertedNew) {
        wtx.nTimeReceived = GetTime();
        wtx.nOrderPos = IncOrderPosNext(&batch);
        wtx.m_it_wtxOrdered = wtxOrdered.insert(std::make_pair(wtx.nOrderPos, &wtx));