| 4563 | } |
| 4564 | |
| 4565 | std::optional<CKey> CWallet::GetKey(const CKeyID& keyid) const |
| 4566 | { |
| 4567 | Assert(IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)); |
| 4568 | |
| 4569 | for (const auto& spkm : GetAllScriptPubKeyMans()) { |
| 4570 | const DescriptorScriptPubKeyMan* desc_spkm = dynamic_cast<DescriptorScriptPubKeyMan*>(spkm); |
| 4571 | assert(desc_spkm); |
| 4572 | LOCK(desc_spkm->cs_desc_man); |
| 4573 | if (std::optional<CKey> key = desc_spkm->GetKey(keyid)) { |
| 4574 | return key; |
| 4575 | } |
| 4576 | } |
| 4577 | return std::nullopt; |
| 4578 | } |
| 4579 | |
| 4580 | void CWallet::WriteBestBlock() const |
| 4581 | { |
no outgoing calls