MCPcopy Create free account
hub / github.com/ElementsProject/elements / LoadActiveScriptPubKeyMan

Method LoadActiveScriptPubKeyMan

src/wallet/wallet.cpp:3747–3765  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3745}
3746
3747void 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
3767void CWallet::DeactivateScriptPubKeyMan(uint256 id, OutputType type, bool internal)
3768{

Callers 1

LoadWalletMethod · 0.80

Calls 6

findMethod · 0.80
ToStringMethod · 0.45
getMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected