diff options
author | Andrew Chow <achow101-github@achow101.com> | 2021-06-04 16:42:33 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2021-06-22 21:57:04 -0400 |
commit | 6dbe4d10728f882986ed0d9ed77bc736f051c662 (patch) | |
tree | 7c8aa8e4b4b15c9840b97be75ef4aff263374345 /src/script | |
parent | 699dfcd8ad9487a4e04c1ffc68211e84e126b3d2 (diff) |
Use BECH32M for tr() desc, WitV1Taproot, and WitUnknown CTxDests
The tr() descriptor, WitnessV1Taproot CTxDestination, and
WitnessUnknown CTxDestination are OutputType::BECH32M so they should
report as such.
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/descriptor.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp index 84a8b06c5c..5da249b7f9 100644 --- a/src/script/descriptor.cpp +++ b/src/script/descriptor.cpp @@ -646,11 +646,13 @@ static std::optional<OutputType> OutputTypeFromDestination(const CTxDestination& return OutputType::LEGACY; } if (std::holds_alternative<WitnessV0KeyHash>(dest) || - std::holds_alternative<WitnessV0ScriptHash>(dest) || - std::holds_alternative<WitnessV1Taproot>(dest) || - std::holds_alternative<WitnessUnknown>(dest)) { + std::holds_alternative<WitnessV0ScriptHash>(dest)) { return OutputType::BECH32; } + if (std::holds_alternative<WitnessV1Taproot>(dest) || + std::holds_alternative<WitnessUnknown>(dest)) { + return OutputType::BECH32M; + } return std::nullopt; } @@ -874,7 +876,7 @@ public: { assert(m_subdescriptor_args.size() == m_depths.size()); } - std::optional<OutputType> GetOutputType() const override { return OutputType::BECH32; } + std::optional<OutputType> GetOutputType() const override { return OutputType::BECH32M; } bool IsSingleType() const final { return true; } }; |