Reject transactions with extra signatures (#18306)
* Reject transactions with extra signatures * fix tests * fix check * fix check * tx method * fix checks
This commit is contained in:
@ -147,6 +147,10 @@ pub mod dedupe_config_program_signers {
|
||||
solana_sdk::declare_id!("8kEuAshXLsgkUEdcFVLqrjCGGHVWFW99ZZpxvAzzMtBp");
|
||||
}
|
||||
|
||||
pub mod verify_tx_signatures_len {
|
||||
solana_sdk::declare_id!("EVW9B5xD9FFK7vw1SBARwMA4s5eRo5eKJdKpsBikzKBz");
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
/// Map of feature identifiers to user-visible description
|
||||
pub static ref FEATURE_NAMES: HashMap<Pubkey, &'static str> = [
|
||||
|
@ -361,6 +361,11 @@ impl Transaction {
|
||||
}
|
||||
}
|
||||
|
||||
/// Verify the length of signatures matches the value in the message header
|
||||
pub fn verify_signatures_len(&self) -> bool {
|
||||
self.signatures.len() == self.message.header.num_required_signatures as usize
|
||||
}
|
||||
|
||||
/// Verify the transaction and hash its message
|
||||
pub fn verify_and_hash_message(&self) -> Result<Hash> {
|
||||
let message_bytes = self.message_data();
|
||||
|
Reference in New Issue
Block a user