Skip to content

Commit 042cd08

Browse files
committed
DefiniteDescriptorKey: disallow multipath keys
When deriving keys we refuse to allow multipath keys. We should forbid them when directly constructing them at all.
1 parent ce9c50f commit 042cd08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/descriptor/key.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ impl DefiniteDescriptorKey {
10371037
///
10381038
/// Returns `None` if the key contains a wildcard
10391039
fn new(key: DescriptorPublicKey) -> Option<Self> {
1040-
if key.has_wildcard() {
1040+
if key.has_wildcard() || key.is_multipath() {
10411041
None
10421042
} else {
10431043
Some(Self(key))
@@ -1071,7 +1071,7 @@ impl FromStr for DefiniteDescriptorKey {
10711071
fn from_str(s: &str) -> Result<Self, Self::Err> {
10721072
let inner = DescriptorPublicKey::from_str(s)?;
10731073
DefiniteDescriptorKey::new(inner).ok_or(DescriptorKeyParseError(
1074-
"cannot parse key with a wilcard as a DerivedDescriptorKey",
1074+
"cannot parse multi-path keys or keys with a wilcard as a DerivedDescriptorKey",
10751075
))
10761076
}
10771077
}

0 commit comments

Comments
 (0)