| 3771 | } |
| 3772 | |
| 3773 | std::optional<bool> CWallet::IsInternalScriptPubKeyMan(ScriptPubKeyMan* spk_man) const |
| 3774 | { |
| 3775 | // only active ScriptPubKeyMan can be internal |
| 3776 | if (!GetActiveScriptPubKeyMans().contains(spk_man)) { |
| 3777 | return std::nullopt; |
| 3778 | } |
| 3779 | |
| 3780 | const auto desc_spk_man = dynamic_cast<DescriptorScriptPubKeyMan*>(spk_man); |
| 3781 | if (!desc_spk_man) { |
| 3782 | throw std::runtime_error(std::string(__func__) + ": unexpected ScriptPubKeyMan type."); |
| 3783 | } |
| 3784 | |
| 3785 | LOCK(desc_spk_man->cs_desc_man); |
| 3786 | const auto& type = desc_spk_man->GetWalletDescriptor().descriptor->GetOutputType(); |
| 3787 | assert(type.has_value()); |
| 3788 | |
| 3789 | return GetScriptPubKeyMan(*type, /* internal= */ true) == desc_spk_man; |
| 3790 | } |
| 3791 | |
| 3792 | util::Result<std::reference_wrapper<DescriptorScriptPubKeyMan>> CWallet::AddWalletDescriptor(WalletDescriptor& desc, const FlatSigningProvider& signing_provider, const std::string& label, bool internal) |
| 3793 | { |
no test coverage detected