Skip to content

Commit cd1085c

Browse files
author
Ludo Galabru
committed
fix: batch inscription
1 parent 03ac9cb commit cd1085c

File tree

1 file changed

+19
-1
lines changed
  • components/chainhook-sdk/src/hord/db

1 file changed

+19
-1
lines changed

components/chainhook-sdk/src/hord/db/mod.rs

+19-1
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,25 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
11591159
}
11601160

11611161
let height = Height(ordinal_block_number.into());
1162-
let ordinal_number = height.starting_sat().0 + ordinal_offset;
1162+
let mut ordinal_number = height.starting_sat().0 + ordinal_offset;
1163+
1164+
if input_index > 0 {
1165+
let tx =
1166+
match find_lazy_block_at_block_height(block_identifier.index as u32, 10, &blocks_db) {
1167+
Some(block) => match block.find_and_serialize_transaction_with_txid(
1168+
&transaction_identifier.get_8_hash_bytes(),
1169+
) {
1170+
Some(entry) => entry,
1171+
None => unreachable!(),
1172+
},
1173+
None => {
1174+
unimplemented!()
1175+
}
1176+
};
1177+
for i in 0..input_index {
1178+
ordinal_number += tx.inputs[i].txin_value;
1179+
}
1180+
}
11631181

11641182
Ok(TraversalResult {
11651183
inscription_number,

0 commit comments

Comments
 (0)