Skip to content

Commit 2a0e75f

Browse files
author
Ludo Galabru
committed
fix: off by one
1 parent 3273c68 commit 2a0e75f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

components/hord-cli/src/core/protocol/inscription_sequencing.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ impl SequenceCursor {
353353
inscription_number + 1
354354
}
355355
_ => {
356-
self.blessed = Some(0);
357356
0
358357
}
359358
}
@@ -376,7 +375,6 @@ impl SequenceCursor {
376375
inscription_number - 1
377376
}
378377
_ => {
379-
self.cursed = Some(-1);
380378
-1
381379
}
382380
}
@@ -514,8 +512,6 @@ pub fn augment_transaction_with_ordinals_inscriptions_data(
514512
OrdinalOperation::InscriptionTransferred(_) => continue,
515513
};
516514

517-
let mut inscription_number = sequence_cursor.pick_next(is_cursed, block_identifier.index);
518-
519515
let transaction_identifier = tx.transaction_identifier.clone();
520516
let traversal = match inscriptions_data
521517
.remove(&(transaction_identifier, inscription.inscription_input_index))
@@ -534,9 +530,8 @@ pub fn augment_transaction_with_ordinals_inscriptions_data(
534530
}
535531
};
536532

533+
// Do we need to curse the inscription because of re-inscription?
537534
let mut curse_type_override = None;
538-
539-
// Do we need to curse the inscription?
540535
if !is_cursed {
541536
// Is this inscription re-inscribing an existing blessed inscription?
542537
if let Some(exisiting_inscription_id) =
@@ -558,6 +553,8 @@ pub fn augment_transaction_with_ordinals_inscriptions_data(
558553
}
559554
};
560555

556+
let mut inscription_number = sequence_cursor.pick_next(is_cursed, block_identifier.index);
557+
561558
let outputs = &tx.metadata.outputs;
562559
inscription.inscription_number = inscription_number;
563560
inscription.ordinal_offset = traversal.get_ordinal_coinbase_offset();

0 commit comments

Comments
 (0)