Skip to content

Commit c07272a

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 7b459e2 commit c07272a

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
@@ -1038,7 +1038,7 @@ impl DefiniteDescriptorKey {
10381038
///
10391039
/// Returns `None` if the key contains a wildcard
10401040
fn new(key: DescriptorPublicKey) -> Option<Self> {
1041-
if key.has_wildcard() {
1041+
if key.has_wildcard() || key.is_multipath() {
10421042
None
10431043
} else {
10441044
Some(Self(key))
@@ -1072,7 +1072,7 @@ impl FromStr for DefiniteDescriptorKey {
10721072
fn from_str(s: &str) -> Result<Self, Self::Err> {
10731073
let inner = DescriptorPublicKey::from_str(s)?;
10741074
DefiniteDescriptorKey::new(inner).ok_or(DescriptorKeyParseError(
1075-
"cannot parse key with a wilcard as a DerivedDescriptorKey",
1075+
"cannot parse multi-path keys or keys with a wilcard as a DerivedDescriptorKey",
10761076
))
10771077
}
10781078
}

0 commit comments

Comments
 (0)