Skip to content

Commit

Permalink
fix: remove unreachable panic; return instead (#490)
Browse files Browse the repository at this point in the history
This error caused chainhook to crash today. This route can happen if a
predicate is completed, but we're still waiting on block confirmations
for fully expire the predicate, and then the user deletes the predicate.
  • Loading branch information
MicaiahReid committed Feb 8, 2024
1 parent 98f9e86 commit abe0fd5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/chainhook-cli/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,10 @@ pub fn set_confirmed_expiration_status(
return;
}
},
None => unreachable!("found no status for predicate: {}", predicate_key),
None => {
// None means the predicate was deleted, so we can just ignore this predicate expiring
return;
}
};
update_predicate_status(
predicate_key,
Expand Down

0 comments on commit abe0fd5

Please sign in to comment.