Skip to content

Commit

Permalink
Fix: Liquid sigops was trying to count for pegins.
Browse files Browse the repository at this point in the history
  • Loading branch information
junderw committed Jan 4, 2024
1 parent e4b8bad commit f0c9fa7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/util/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit f0c9fa7

Please sign in to comment.