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

Method DeactivateScriptPubKeyMan

src/wallet/wallet.cpp:3767–3782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3765}
3766
3767void CWallet::DeactivateScriptPubKeyMan(uint256 id, OutputType type, bool internal)
3768{
3769 auto spk_man = GetScriptPubKeyMan(type, internal);
3770 if (spk_man != nullptr && spk_man->GetID() == id) {
3771 WalletLogPrintf("Deactivate spkMan: id = %s, type = %d, internal = %d\n", id.ToString(), static_cast<int>(type), static_cast<int>(internal));
3772 WalletBatch batch(GetDatabase());
3773 if (!batch.EraseActiveScriptPubKeyMan(static_cast<uint8_t>(type), internal)) {
3774 throw std::runtime_error(std::string(__func__) + ": erasing active ScriptPubKeyMan id failed");
3775 }
3776
3777 auto& spk_mans = internal ? m_internal_spk_managers : m_external_spk_managers;
3778 spk_mans.erase(type);
3779 }
3780
3781 NotifyCanGetAddressesChanged();
3782}
3783
3784bool CWallet::IsLegacy() const
3785{

Callers 1

backup.cppFile · 0.80

Calls 5

GetIDMethod · 0.45
ToStringMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected