From b6b3e2fa39d996ff1ad0be3737c7c2396338a927 Mon Sep 17 00:00:00 2001 From: QI ZHANG Date: Tue, 11 Jan 2022 20:39:13 -0500 Subject: [PATCH] complete the threshold check (#45) --- programs/multisig/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/multisig/src/lib.rs b/programs/multisig/src/lib.rs index 768d504..388f019 100644 --- a/programs/multisig/src/lib.rs +++ b/programs/multisig/src/lib.rs @@ -36,7 +36,7 @@ pub mod serum_multisig { nonce: u8, ) -> Result<()> { assert_unique_owners(&owners)?; - require!(threshold > 0, InvalidThreshold); + require!(threshold > 0 && threshold <= owners.len() as u64, InvalidThreshold); require!(!owners.is_empty(), InvalidOwnersLen); let multisig = &mut ctx.accounts.multisig;