From f0c9fa7c5fd4720faaec2c0f6617b23f7163d61c Mon Sep 17 00:00:00 2001 From: junderw Date: Thu, 4 Jan 2024 22:19:23 +0900 Subject: [PATCH] Fix: Liquid sigops was trying to count for pegins. --- src/util/transaction.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/transaction.rs b/src/util/transaction.rs index db9ba066..c9ff29ae 100644 --- a/src/util/transaction.rs +++ b/src/util/transaction.rs @@ -136,11 +136,11 @@ pub(super) mod sigops { let mut prevouts = Vec::with_capacity(input_count); #[cfg(not(feature = "liquid"))] - let is_coinbase = tx.is_coin_base(); + let is_coinbase_or_pegin = tx.is_coin_base(); #[cfg(feature = "liquid")] - let is_coinbase = tx.is_coinbase(); + let is_coinbase_or_pegin = tx.is_coinbase() || tx.input.iter().any(|input| input.is_pegin); - if !is_coinbase { + if !is_coinbase_or_pegin { for idx in 0..input_count { prevouts.push( *prevout_map @@ -311,7 +311,7 @@ pub(super) mod sigops { return Ok(n_sigop_cost); } #[cfg(feature = "liquid")] - if tx.is_coinbase() { + if tx.is_coinbase() || tx.input.iter().any(|input| input.is_pegin) { return Ok(n_sigop_cost); } if tx.input.len() != previous_outputs.len() {