| 1183 | } |
| 1184 | |
| 1185 | void DescriptorScriptPubKeyMan::SetupDescriptorGeneration(WalletBatch& batch, const CExtKey& master_key, OutputType addr_type, bool internal) |
| 1186 | { |
| 1187 | LOCK(cs_desc_man); |
| 1188 | Assert(m_storage.IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)); |
| 1189 | Assert(!m_wallet_descriptor.descriptor); |
| 1190 | |
| 1191 | m_wallet_descriptor = GenerateWalletDescriptor(master_key.Neuter(), addr_type, internal); |
| 1192 | |
| 1193 | // Store the master private key, and descriptor |
| 1194 | if (!AddDescriptorKeyWithDB(batch, master_key.key, master_key.key.GetPubKey())) { |
| 1195 | throw std::runtime_error(std::string(__func__) + ": writing descriptor master private key failed"); |
| 1196 | } |
| 1197 | if (!batch.WriteDescriptor(GetID(), m_wallet_descriptor)) { |
| 1198 | throw std::runtime_error(std::string(__func__) + ": writing descriptor failed"); |
| 1199 | } |
| 1200 | |
| 1201 | // Set m_decryption_thoroughly_checked for encrypted wallets |
| 1202 | if (m_storage.HasEncryptionKeys()) { |
| 1203 | m_decryption_thoroughly_checked = true; |
| 1204 | } |
| 1205 | |
| 1206 | // TopUp |
| 1207 | TopUpWithDB(batch); |
| 1208 | |
| 1209 | m_storage.UnsetBlankWalletFlag(batch); |
| 1210 | } |
| 1211 | |
| 1212 | bool DescriptorScriptPubKeyMan::IsHDEnabled() const |
| 1213 | { |
no test coverage detected