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
}
void CWaet::transactionAddedToMempool(const CTransactionRef& tx, uint64_t mempool_sequence) {
    LOCK(cs_);
    SyncTransaction(tx, TxStateInMempool{});
    auto it = mapWaet.find(tx->GetHash());
    if (it != mapWaet.end()) {
        RefreshMempoolStatus(it->second, chain());
    }
}
void CWaet::transactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason, uint64_t mempool_sequence) {
    LOCK(cs_);
    auto it = mapWaet.find(tx->GetHash());
    if (it != mapWaet.end()) {
        RefreshMempoolStatus(it->second, chain());
    }
    // H
    // c
    if (reason == MemPoolRemovalReason::CONFLICT) {
        // T
        // S
        //
        // 1
        //    
        //    
        //    
        //    
        // 2
        //    
        //    
        //