Skip to content

Commit

Permalink
fix: don't evaluate transactions for block predicates (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
MicaiahReid authored Oct 11, 2023
1 parent 8c4e5ea commit 0e84fe7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/chainhook-sdk/src/chainhooks/stacks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,11 @@ pub fn evaluate_stacks_chainhook_on_blocks<'a>(
for block in blocks {
if end_block >= block.get_identifier().index {
let mut hits = vec![];
if chainhook.is_predicate_targeting_block_header()
&& evaluate_stacks_predicate_on_block(block, chainhook, ctx)
{
for tx in block.get_transactions().iter() {
hits.push(tx);
if chainhook.is_predicate_targeting_block_header() {
if evaluate_stacks_predicate_on_block(block, chainhook, ctx) {
for tx in block.get_transactions().iter() {
hits.push(tx);
}
}
} else {
for tx in block.get_transactions().iter() {
Expand Down

0 comments on commit 0e84fe7

Please sign in to comment.