Skip to content

Commit cb01eb5

Browse files
author
Ludo Galabru
committed
fix: handle non-spending transaction
1 parent 9431684 commit cb01eb5

File tree

1 file changed

+14
-0
lines changed
  • components/chainhook-event-observer/src/hord/db

1 file changed

+14
-0
lines changed

components/chainhook-event-observer/src/hord/db/mod.rs

+14
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,13 @@ pub fn retrieve_satoshi_point_using_local_storage(
10891089
local_block_cache.clear();
10901090

10911091
hops += 1;
1092+
if hops as u64 > block_identifier.index {
1093+
return Err(format!(
1094+
"Unable to process transaction {}, manual investigation required",
1095+
transaction_identifier.hash
1096+
));
1097+
}
1098+
10921099
let block = match local_block_cache.get(&ordinal_block_number) {
10931100
Some(block) => block,
10941101
None => match find_block_at_block_height(ordinal_block_number, 3, &blocks_db) {
@@ -1205,6 +1212,13 @@ pub fn retrieve_satoshi_point_using_local_storage(
12051212
break;
12061213
}
12071214
}
1215+
1216+
if sats_in == 0 {
1217+
return Err(format!(
1218+
"Transaction {} is originating from a non spending transaction",
1219+
transaction_identifier.hash
1220+
));
1221+
}
12081222
}
12091223
}
12101224
}

0 commit comments

Comments
 (0)