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(cs_);
    const CWaetTx* srctx = GetWaetTx(hash);
    if (!srctx) return;
    CTxDestination dst;
    if (ExtractDestination(srctx->tx->vout[n].scriptPubKey, dst)) {
        if (IsMine(dst)) {
            if (used != IsAddressUsed(dst)) {
                if (used) {
                    tx_destinations.insert(dst);
                }
                SetAddressUsed(batch, dst, used);
            }
        }
    }
}
bool CWaet::IsSKey(const uint256& hash, unsigned int n) const