https://cirrus-ci.com/task/5603470202896384?logs=ci#L2681
}
        auto& spk_mans = internal ? m_internal_spk_managers  m_external_spk_managers;
        spk_mans.erase(type);
    }
    NotifyCanGetAddressesChanged();
}
bool CWalletIsLegacy() const
{
    if (m_internal_spk_managers.count(OutputTypeLEGACY) == 0) {
        return false;
    }
    auto spk_man = dynamic_cast<LegacyScriptPubKeyMan*>(m_internal_spk_managers.at(OutputTypeLEGACY));
    return spk_man != nullptr;
}
DescriptorScriptPubKeyMan* CWalletGetDescriptorScriptPubKeyMan(const WalletDescriptor& desc) const
{
    for (auto& spk_man_pair  m_spk_managers) {
        // Try to downcast to DescriptorScriptPubKeyMan then check if the s match
        DescriptorScriptPubKeyMan* spk_manager = dynamic_cast<DescriptorScriptPubKeyMan*>(spk_man_pair.second.get());
        if (spk_manager != nullptr && spk_manager->HasWalletDescriptor(desc)) {
            return spk_manager;
        }
    }
    return nullptr;
}
stdoptional<bool> CWalletIsInternalScriptPubKeyMan(ScriptPubKeyMan* spk_man) const
{
    // Legacy script pubkey man can't be either external or internal
    if (IsLegacy()) {
        return stdnullopt;