From 16b975496e533783eb3aa5934c11ba140ba3b7f2 Mon Sep 17 00:00:00 2001 From: mainnet-pat Date: Sun, 6 Apr 2025 06:06:18 +0000 Subject: [PATCH] Handle unhandled exceptions in parse_bytecode_pattern_redeem --- .../hasura-data/migrations/default/1616195337538_init/up.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/images/hasura/hasura-data/migrations/default/1616195337538_init/up.sql b/images/hasura/hasura-data/migrations/default/1616195337538_init/up.sql index b3c9e28..7a84632 100644 --- a/images/hasura/hasura-data/migrations/default/1616195337538_init/up.sql +++ b/images/hasura/hasura-data/migrations/default/1616195337538_init/up.sql @@ -635,6 +635,7 @@ BEGIN ELSE RETURN parse_bytecode_pattern(maybe_redeem); END IF; +EXCEPTION WHEN OTHERS THEN RETURN NULL; END; $$; COMMENT ON FUNCTION parse_bytecode_pattern_redeem (bytea) IS 'Parse VM unlocking bytecode to identify the final instruction. If the last instruction is a push, attempt to parse its contents as P2SH redeem bytecode, extracting the first byte of each instruction into a bytecode pattern (excluding length bytes and pushed data). If the last instruction is not a push, return NULL.';