| 3739 | } |
| 3740 | |
| 3741 | void 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 | |
| 3758 | DescriptorScriptPubKeyMan* CWallet::GetDescriptorScriptPubKeyMan(const WalletDescriptor& desc) const |
| 3759 | { |
no test coverage detected