addmultisigaddress creates an address respecting the setting, being unable to generate a specific type of address without also adding it to the wallet seems wrong.

I suppose in the future `addresstype` may be refactored to be wallet-specific, which would leave this non-wallet rpc call without an argument. Perhaps there should just be an optional parameter to set it.
const CTransaction& tx = *ptx;
    if (!AddToWalletIfInvolvingMe(ptx, pindex, posInBlock, true))
        return; 
    
    
    
    for (const CTxIn& txin : tx.vin) {
        auto it = mapWallet.find(txin.prevout.hash);
        if (it != mapWallet.end()) {
            it->second.MarkDirty();
        }
    }
}
void CWallet::TransactionAddedToMempool(const CTransactionRef& ptx) {
    LOCK2(cs_main, cs_wallet);
    SyncTransaction(ptx);
    auto it = mapWallet.find(ptx->GetHash());
    if (it != mapWallet.end()) {
        it->second.fInMempool = true;
    }
}
void CWallet::TransactionRemovedFromMempool(const CTransactionRef &ptx) {