Skip to content

Commit 9f2f263

Browse files
authored
Merge pull request #208 from darosior/standard_sortedmulti
Standard sortedmulti
2 parents de1a5b2 + ada5277 commit 9f2f263

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/descriptor/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,11 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> SortedMultiVec<Pk, Ctx> {
862862
///
863863
/// Internally checks all the applicable size limits and pubkey types limitations according to the current `Ctx`.
864864
pub fn new(k: usize, pks: Vec<Pk>) -> Result<Self, Error> {
865+
// A sortedmulti() is only defined for <= 20 keys (it maps to CHECKMULTISIG)
866+
if pks.len() > 20 {
867+
Error::BadDescriptor("Too many public keys".to_string());
868+
}
869+
865870
// Check the limits before creating a new SortedMultiVec
866871
// For example, under p2sh context the scriptlen can only be
867872
// upto 520 bytes.

0 commit comments

Comments
 (0)