Skip to content

Commit b41daad

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 c585c27 commit b41daad

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
@@ -1058,7 +1058,7 @@ impl DefiniteDescriptorKey {
10581058
///
10591059
/// Returns `None` if the key contains a wildcard
10601060
fn new(key: DescriptorPublicKey) -> Option<Self> {
1061-
if key.has_wildcard() {
1061+
if key.has_wildcard() || key.is_multipath() {
10621062
None
10631063
} else {
10641064
Some(Self(key))
@@ -1092,7 +1092,7 @@ impl FromStr for DefiniteDescriptorKey {
10921092
fn from_str(s: &str) -> Result<Self, Self::Err> {
10931093
let inner = DescriptorPublicKey::from_str(s)?;
10941094
DefiniteDescriptorKey::new(inner).ok_or(DescriptorKeyParseError(
1095-
"cannot parse key with a wilcard as a DerivedDescriptorKey",
1095+
"cannot parse multi-path keys or keys with a wilcard as a DerivedDescriptorKey",
10961096
))
10971097
}
10981098
}

0 commit comments

Comments
 (0)