MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / DeactivateScriptPubKeyMan

Method DeactivateScriptPubKeyMan

src/wallet/wallet.cpp:3741–3756  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3739}
3740
3741void CWallet::DeactivateScriptPubKeyMan(uint256 id, OutputType type, bool internal)
3742{
3743 auto spk_man = GetScriptPubKeyMan(type, internal);
3744 if (spk_man != nullptr && spk_man->GetID() == id) {
3745 WalletLogPrintf("Deactivate spkMan: id = %s, type = %s, internal = %s\n", id.ToString(), FormatOutputType(type), internal ? "true" : "false");
3746 WalletBatch batch(GetDatabase());
3747 if (!batch.EraseActiveScriptPubKeyMan(static_cast<uint8_t>(type), internal)) {
3748 throw std::runtime_error(std::string(__func__) + ": erasing active ScriptPubKeyMan id failed");
3749 }
3750
3751 auto& spk_mans = internal ? m_internal_spk_managers : m_external_spk_managers;
3752 spk_mans.erase(type);
3753 }
3754
3755 NotifyCanGetAddressesChanged();
3756}
3757
3758DescriptorScriptPubKeyMan* CWallet::GetDescriptorScriptPubKeyMan(const WalletDescriptor& desc) const
3759{

Callers 1

backup.cppFile · 0.80

Calls 5

GetIDMethod · 0.45
ToStringMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected