| 3745 | } |
| 3746 | |
| 3747 | void CWallet::LoadActiveScriptPubKeyMan(uint256 id, OutputType type, bool internal) |
| 3748 | { |
| 3749 | // Activating ScriptPubKeyManager for a given output and change type is incompatible with legacy wallets. |
| 3750 | // Legacy wallets have only one ScriptPubKeyManager and it's active for all output and change types. |
| 3751 | Assert(IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)); |
| 3752 | |
| 3753 | WalletLogPrintf("Setting spkMan to active: id = %s, type = %d, internal = %d\n", id.ToString(), static_cast<int>(type), static_cast<int>(internal)); |
| 3754 | auto& spk_mans = internal ? m_internal_spk_managers : m_external_spk_managers; |
| 3755 | auto& spk_mans_other = internal ? m_external_spk_managers : m_internal_spk_managers; |
| 3756 | auto spk_man = m_spk_managers.at(id).get(); |
| 3757 | spk_mans[type] = spk_man; |
| 3758 | |
| 3759 | const auto it = spk_mans_other.find(type); |
| 3760 | if (it != spk_mans_other.end() && it->second == spk_man) { |
| 3761 | spk_mans_other.erase(type); |
| 3762 | } |
| 3763 | |
| 3764 | NotifyCanGetAddressesChanged(); |
| 3765 | } |
| 3766 | |
| 3767 | void CWallet::DeactivateScriptPubKeyMan(uint256 id, OutputType type, bool internal) |
| 3768 | { |
no test coverage detected