From 0e84fe7e2b6098345eee4b997138e6910a849996 Mon Sep 17 00:00:00 2001 From: Micaiah Reid Date: Wed, 11 Oct 2023 15:52:53 -0400 Subject: [PATCH] fix: don't evaluate transactions for block predicates (#445) --- components/chainhook-sdk/src/chainhooks/stacks/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/chainhook-sdk/src/chainhooks/stacks/mod.rs b/components/chainhook-sdk/src/chainhooks/stacks/mod.rs index 9e8c1a81d..5e5afb300 100644 --- a/components/chainhook-sdk/src/chainhooks/stacks/mod.rs +++ b/components/chainhook-sdk/src/chainhooks/stacks/mod.rs @@ -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() {