mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Support h instead of ' in hardened descriptor paths
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
// * X
|
||||
// * E/I: unhardened child
|
||||
// * E/I': hardened child
|
||||
// * E/Ih: hardened child (alternative notation)
|
||||
//
|
||||
// The top level is S.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user