diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2018-07-27 12:21:12 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2018-07-27 12:21:12 -0700 |
commit | f6b7fc349ccf9cfbeb7e91e19c20e2a2fcc9026f (patch) | |
tree | 4f5e3cb6933ef7399fb69d47b935b3ab24467c23 /src/script | |
parent | fddea672eb8f63012f2e9ce04fa477e5d4140750 (diff) |
Support h instead of ' in hardened descriptor paths
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/descriptor.cpp | 4 | ||||
-rw-r--r-- | src/script/descriptor.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp index bbeabab372..f366b99ec3 100644 --- a/src/script/descriptor.cpp +++ b/src/script/descriptor.cpp @@ -436,7 +436,7 @@ bool ParseKeyPath(const std::vector<Span<const char>>& split, KeyPath& out) for (size_t i = 1; i < split.size(); ++i) { Span<const char> elem = split[i]; bool hardened = false; - if (elem.size() > 0 && elem[elem.size() - 1] == '\'') { + if (elem.size() > 0 && (elem[elem.size() - 1] == '\'' || elem[elem.size() - 1] == 'h')) { elem = elem.first(elem.size() - 1); hardened = true; } @@ -472,7 +472,7 @@ std::unique_ptr<PubkeyProvider> ParsePubkey(const Span<const char>& sp, bool per if (split.back() == MakeSpan("*").first(1)) { split.pop_back(); type = DeriveType::UNHARDENED; - } else if (split.back() == MakeSpan("*'").first(2)) { + } else if (split.back() == MakeSpan("*'").first(2) || split.back() == MakeSpan("*h").first(2)) { split.pop_back(); type = DeriveType::HARDENED; } diff --git a/src/script/descriptor.h b/src/script/descriptor.h index d7c7ccbfb6..e079c72e92 100644 --- a/src/script/descriptor.h +++ b/src/script/descriptor.h @@ -68,6 +68,7 @@ // * X // * E/I: unhardened child // * E/I': hardened child +// * E/Ih: hardened child (alternative notation) // // The top level is S. |