diff --git a/stackslib/src/chainstate/stacks/auth.rs b/stackslib/src/chainstate/stacks/auth.rs index 9cc1c1d30e..5ba40fceea 100644 --- a/stackslib/src/chainstate/stacks/auth.rs +++ b/stackslib/src/chainstate/stacks/auth.rs @@ -373,27 +373,21 @@ impl StacksMessageCodec for OrderIndependentMultisigSpendingCondition { } // must be given the right number of signatures - if num_sigs_given != signatures_required { - test_debug!( - "Failed to deserialize order independent multisig spending condition: got {} sigs, expected {}", - num_sigs_given, - signatures_required + if num_sigs_given < signatures_required { + let msg = format!( + "Failed to deserialize order independent multisig spending condition: got {num_sigs_given} sigs, expected at least {signatures_required}" ); - return Err(codec_error::DeserializeError(format!( - "Failed to parse order independent multisig spending condition: got {} sigs, expected {}", - num_sigs_given, signatures_required - ))); + test_debug!("{msg}"); + return Err(codec_error::DeserializeError(msg)); } // must all be compressed if we're using P2WSH if have_uncompressed && hash_mode == OrderIndependentMultisigHashMode::P2WSH { - test_debug!( + let msg = format!( "Failed to deserialize order independent multisig spending condition: expected compressed keys only" ); - return Err(codec_error::DeserializeError( - "Failed to parse order independent multisig spending condition: expected compressed keys only" - .to_string(), - )); + test_debug!("{msg}"); + return Err(codec_error::DeserializeError(msg)); } Ok(OrderIndependentMultisigSpendingCondition { @@ -481,10 +475,11 @@ impl OrderIndependentMultisigSpendingCondition { pubkeys.push(pubkey); } - if num_sigs != self.signatures_required { - return Err(net_error::VerifyingError( - "Incorrect number of signatures".to_string(), - )); + if num_sigs < self.signatures_required { + return Err(net_error::VerifyingError(format!( + "Not enough signatures. Got {num_sigs}, expected at least {req}", + req = self.signatures_required + ))); } if have_uncompressed && self.hash_mode == OrderIndependentMultisigHashMode::P2WSH { diff --git a/stackslib/src/net/api/getblock_v3.rs b/stackslib/src/net/api/getblock_v3.rs index 344aa6d746..090afec04c 100644 --- a/stackslib/src/net/api/getblock_v3.rs +++ b/stackslib/src/net/api/getblock_v3.rs @@ -23,7 +23,6 @@ use serde::de::Error as de_Error; use stacks_common::codec::{StacksMessageCodec, MAX_MESSAGE_LEN}; use stacks_common::types::chainstate::{ConsensusHash, StacksBlockId}; use stacks_common::types::net::PeerHost; -use stacks_common::types::StacksEpochId; use stacks_common::util::hash::to_hex; use {serde, serde_json};