| 3473 | } |
| 3474 | |
| 3475 | LegacyScriptPubKeyMan* CWallet::GetLegacyScriptPubKeyMan() const |
| 3476 | { |
| 3477 | if (IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) { |
| 3478 | return nullptr; |
| 3479 | } |
| 3480 | // Legacy wallets only have one ScriptPubKeyMan which is a LegacyScriptPubKeyMan. |
| 3481 | // Everything in m_internal_spk_managers and m_external_spk_managers point to the same legacyScriptPubKeyMan. |
| 3482 | auto it = m_internal_spk_managers.find(OutputType::LEGACY); |
| 3483 | if (it == m_internal_spk_managers.end()) return nullptr; |
| 3484 | return dynamic_cast<LegacyScriptPubKeyMan*>(it->second); |
| 3485 | } |
| 3486 | |
| 3487 | LegacyScriptPubKeyMan* CWallet::GetOrCreateLegacyScriptPubKeyMan() |
| 3488 | { |