diff options
Diffstat (limited to 'src/wallet/scriptpubkeyman.cpp')
-rw-r--r-- | src/wallet/scriptpubkeyman.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index 9173c790d4..0b4632bd99 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -528,7 +528,7 @@ static int64_t GetOldestKeyTimeInPool(const std::set<int64_t>& setKeyPool, Walle return keypool.nTime; } -int64_t LegacyScriptPubKeyMan::GetOldestKeyPoolTime() const +std::optional<int64_t> LegacyScriptPubKeyMan::GetOldestKeyPoolTime() const { LOCK(cs_KeyStore); @@ -1876,12 +1876,6 @@ bool DescriptorScriptPubKeyMan::AddDescriptorKeyWithDB(WalletBatch& batch, const bool DescriptorScriptPubKeyMan::SetupDescriptorGeneration(const CExtKey& master_key, OutputType addr_type, bool internal) { - if (addr_type == OutputType::BECH32M) { - // Don't allow setting up taproot descriptors yet - // TODO: Allow setting up taproot descriptors - return false; - } - LOCK(cs_desc_man); assert(m_storage.IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)); @@ -1911,7 +1905,10 @@ bool DescriptorScriptPubKeyMan::SetupDescriptorGeneration(const CExtKey& master_ desc_prefix = "wpkh(" + xpub + "/84'"; break; } - case OutputType::BECH32M: assert(false); // TODO: Setup taproot descriptor + case OutputType::BECH32M: { + desc_prefix = "tr(" + xpub + "/86'"; + break; + } } // no default case, so the compiler can warn about missing cases assert(!desc_prefix.empty()); @@ -1970,11 +1967,10 @@ bool DescriptorScriptPubKeyMan::HavePrivateKeys() const return m_map_keys.size() > 0 || m_map_crypted_keys.size() > 0; } -int64_t DescriptorScriptPubKeyMan::GetOldestKeyPoolTime() const +std::optional<int64_t> DescriptorScriptPubKeyMan::GetOldestKeyPoolTime() const { // This is only used for getwalletinfo output and isn't relevant to descriptor wallets. - // The magic number 0 indicates that it shouldn't be displayed so that's what we return. - return 0; + return std::nullopt; } |