| 15 | |
| 16 | namespace wallet { |
| 17 | bool ExternalSignerScriptPubKeyMan::SetupDescriptor(std::unique_ptr<Descriptor> desc) |
| 18 | { |
| 19 | LOCK(cs_desc_man); |
| 20 | assert(m_storage.IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)); |
| 21 | assert(m_storage.IsWalletFlagSet(WALLET_FLAG_EXTERNAL_SIGNER)); |
| 22 | |
| 23 | int64_t creation_time = GetTime(); |
| 24 | |
| 25 | // Make the descriptor |
| 26 | WalletDescriptor w_desc(std::move(desc), creation_time, 0, 0, 0); |
| 27 | m_wallet_descriptor = w_desc; |
| 28 | |
| 29 | // Store the descriptor |
| 30 | WalletBatch batch(m_storage.GetDatabase()); |
| 31 | if (!batch.WriteDescriptor(GetID(), m_wallet_descriptor)) { |
| 32 | throw std::runtime_error(std::string(__func__) + ": writing descriptor failed"); |
| 33 | } |
| 34 | |
| 35 | // TopUp |
| 36 | TopUp(); |
| 37 | |
| 38 | m_storage.UnsetBlankWalletFlag(batch); |
| 39 | return true; |
| 40 | } |
| 41 | |
| 42 | ExternalSigner ExternalSignerScriptPubKeyMan::GetExternalSigner() { |
| 43 | const std::string command = gArgs.GetArg("-signer", ""); |
no test coverage detected