Skip to content

Commit

Permalink
Merge branch 'master' into optimize-window-cache-building-for-ibd
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Stacks authored Oct 22, 2024
2 parents aecdef8 + aac16a9 commit 408cef7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ mod panic_handler {
fn stack(error: &Error) -> String;
}

pub fn process(info: &std::panic::PanicInfo) -> String {
pub fn process(info: &std::panic::PanicHookInfo) -> String {
let mut msg = info.to_string();

// Add the error stack to our message.
Expand Down Expand Up @@ -1053,7 +1053,7 @@ mod panic_handler {
impl KaspaCli {
pub fn init_panic_hook(self: &Arc<Self>) {
let this = self.clone();
let handler = move |info: &std::panic::PanicInfo| {
let handler = move |info: &std::panic::PanicHookInfo| {
let msg = panic_handler::process(info);
this.term().writeln(msg.crlf());
panic_handler::console_error(msg);
Expand Down
2 changes: 1 addition & 1 deletion cli/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub fn try_parse_required_nonzero_kaspa_as_sompi_u64<S: ToString + Display>(kasp
let sompi_amount = kaspa_amount
.to_string()
.parse::<f64>()
.map_err(|_| Error::custom(format!("Supplied Kasapa amount is not valid: '{kaspa_amount}'")))?
.map_err(|_| Error::custom(format!("Supplied Kaspa amount is not valid: '{kaspa_amount}'")))?
* SOMPI_PER_KASPA as f64;
if sompi_amount < 0.0 {
Err(Error::custom("Supplied Kaspa amount is not valid: '{kaspa_amount}'"))
Expand Down
1 change: 1 addition & 0 deletions crypto/txscript/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ fn parse_script<T: VerifiableTransaction, Reused: SigHashReusedValues>(
script.iter().batching(|it| deserialize_next_opcode(it))
}

#[must_use]
pub fn get_sig_op_count<T: VerifiableTransaction, Reused: SigHashReusedValues>(
signature_script: &[u8],
prev_script_public_key: &ScriptPublicKey,
Expand Down
2 changes: 1 addition & 1 deletion mining/errors/src/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub enum NonStandardError {
RejectInsufficientFee(TransactionId, u64, u64),

#[error("transaction input #{1} has {2} signature operations which is more than the allowed max amount of {3}")]
RejectSignatureCount(TransactionId, usize, u8, u8),
RejectSignatureCount(TransactionId, usize, u64, u8),
}

impl NonStandardError {
Expand Down
5 changes: 2 additions & 3 deletions mining/src/mempool/check_transaction_standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,11 @@ impl Mempool {
ScriptClass::PubKey => {}
ScriptClass::PubKeyECDSA => {}
ScriptClass::ScriptHash => {
get_sig_op_count::<PopulatedTransaction, SigHashReusedValuesUnsync>(
let num_sig_ops = get_sig_op_count::<PopulatedTransaction, SigHashReusedValuesUnsync>(
&input.signature_script,
&entry.script_public_key,
);
let num_sig_ops = 1;
if num_sig_ops > MAX_STANDARD_P2SH_SIG_OPS {
if num_sig_ops > MAX_STANDARD_P2SH_SIG_OPS as u64 {
return Err(NonStandardError::RejectSignatureCount(transaction_id, i, num_sig_ops, MAX_STANDARD_P2SH_SIG_OPS));
}
}
Expand Down

0 comments on commit 408cef7

Please sign in to comment.