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.
{
    
    
    
    
    
    bool ret = ::AcceptToMemoryPool(mempool, state, tx, nullptr ,
                                nullptr , false , nAbsurdFee);
    fInMempool |= ret;
    return ret;
}
void CWallet::LearnRelatedScripts(const CPubKey& key, OutputType type)
{
    if (key.IsCompressed() && (type == OutputType::P2SH_SEGWIT || type == OutputType::BECH32)) {
        CTxDestination witdest = WitnessV0KeyHash(key.GetID());
        CScript witprog = GetScriptForDestination(witdest);
        
        assert(IsSolvable(*this, witprog));
        AddCScript(witprog);
    }
}
void CWallet::LearnAllRelatedScripts(const CPubKey& key)
{
    
    LearnRelatedScripts(key, OutputType::P2SH_SEGWIT);
}