File tree 1 file changed +7
-2
lines changed
components/chainhook-event-observer/src/hord/db
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1325,13 +1325,16 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
1325
1325
}
1326
1326
1327
1327
let fee = total_in - total_out;
1328
- accumulated_fees += fee;
1329
- if accumulated_fees > ordinal_offset {
1328
+ if accumulated_fees + fee > ordinal_offset {
1330
1329
// We are looking at the right transaction
1331
1330
// Retraverse the inputs to select the index to be picked
1331
+ let offset_within_fee = ordinal_offset - accumulated_fees;
1332
+ total_out += offset_within_fee;
1332
1333
let mut sats_in = 0 ;
1334
+
1333
1335
for input in tx. inputs . into_iter ( ) {
1334
1336
sats_in += input. txin_value ;
1337
+
1335
1338
if sats_in >= total_out {
1336
1339
ordinal_offset = total_out - ( sats_in - input. txin_value ) ;
1337
1340
ordinal_block_number = input. block_height ;
@@ -1340,6 +1343,8 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
1340
1343
}
1341
1344
}
1342
1345
break ;
1346
+ } else {
1347
+ accumulated_fees += fee;
1343
1348
}
1344
1349
}
1345
1350
} else {
You can’t perform that action at this time.
0 commit comments