diff options
author | Andrew Chow <achow101-github@achow101.com> | 2021-06-04 16:38:47 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2021-06-22 21:53:11 -0400 |
commit | 0262536c34567743e527dad46912c9ba493252cd (patch) | |
tree | 46bf2bac96cdb0bd7a5a960d573e0a6dd175bed9 /src/wallet | |
parent | 177c15d2f7cd5406ddbce8217fc023057539b828 (diff) |
Add OutputType::BECH32M
Bech32m addresses need their own OutputType
We are not ready to create DescriptorScriptPubKeyMans which produce
bech32m addresses. So don't allow generating them.
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/scriptpubkeyman.cpp | 7 | ||||
-rw-r--r-- | src/wallet/wallet.cpp | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index 4212b6f34a..dedd40694e 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -1889,6 +1889,12 @@ bool DescriptorScriptPubKeyMan::AddDescriptorKeyWithDB(WalletBatch& batch, const bool DescriptorScriptPubKeyMan::SetupDescriptorGeneration(const CExtKey& master_key, OutputType addr_type) { + 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)); @@ -1918,6 +1924,7 @@ bool DescriptorScriptPubKeyMan::SetupDescriptorGeneration(const CExtKey& master_ desc_prefix = "wpkh(" + xpub + "/84'"; break; } + case OutputType::BECH32M: assert(false); // TODO: Setup taproot descriptor } // no default case, so the compiler can warn about missing cases assert(!desc_prefix.empty()); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 63d0f4cf41..fbda77ed62 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3086,6 +3086,11 @@ void CWallet::SetupDescriptorScriptPubKeyMans() for (bool internal : {false, true}) { for (OutputType t : OUTPUT_TYPES) { + if (t == OutputType::BECH32M) { + // Skip taproot (bech32m) for now + // TODO: Setup taproot (bech32m) descriptors by default + continue; + } auto spk_manager = std::unique_ptr<DescriptorScriptPubKeyMan>(new DescriptorScriptPubKeyMan(*this, internal)); if (IsCrypted()) { if (IsLocked()) { |