File tree 2 files changed +12
-0
lines changed
components/ordhook-core/src/core
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,12 @@ pub enum SatPosition {
59
59
pub fn resolve_absolute_pointer ( inputs : & Vec < u64 > , absolute_pointer_value : u64 ) -> ( usize , u64 ) {
60
60
let mut selected_index = 0 ;
61
61
let mut cumulated_input_value = 0 ;
62
+ // Check for overflow
63
+ let total: u64 = inputs. iter ( ) . sum ( ) ;
64
+ if absolute_pointer_value > total {
65
+ return ( 0 , 0 )
66
+ }
67
+ // Identify the input + satoshi offset being inscribed
62
68
for ( index, input_value) in inputs. iter ( ) . enumerate ( ) {
63
69
if ( cumulated_input_value + input_value) > absolute_pointer_value {
64
70
selected_index = index;
Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ pub fn parse_inscriptions_from_witness(
21
21
witness_bytes : Vec < Vec < u8 > > ,
22
22
txid : & str ,
23
23
) -> Option < Vec < OrdinalInscriptionRevealData > > {
24
+
25
+ // Efficient debugging: Isolate one specific transaction
26
+ // if !txid.eq("aa2ab56587c7d6609c95157e6dff37c5c3fa6531702f41229a289a5613887077") {
27
+ // return None
28
+ // }
29
+
24
30
let witness = Witness :: from_slice ( & witness_bytes) ;
25
31
let tapscript = witness. tapscript ( ) ?;
26
32
let envelopes: Vec < Envelope < Inscription > > = RawEnvelope :: from_tapscript ( tapscript, input_index)
You can’t perform that action at this time.
0 commit comments