Skip to main content

check_threshold

Function check_threshold 

Source
pub fn check_threshold(
    accounts: &[&AccountView],
    threshold: u8,
) -> ProgramResult
Expand description

Require at least threshold of the provided accounts to be signers.

Also checks that all accounts have unique addresses to prevent the duplicate-signer attack (passing the same signer key in multiple slots).

Returns MissingRequiredSignature if fewer than threshold are signers. Returns InvalidArgument if duplicate addresses are found.