Skip to content

Commit 8ea5bdf

Browse files
author
Ludo Galabru
committed
feat: re-implement satoshi overflows handling
1 parent 04c5f37 commit 8ea5bdf

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

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

+25-2
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,31 @@ pub fn augment_block_with_ordinals_inscriptions_data(
470470
}
471471

472472
// Handle sats overflow
473-
while let Some(sats_overlow) = sats_overflows.pop_front() {
474-
// TODO
473+
while let Some((tx_index, op_index)) = sats_overflows.pop_front() {
474+
let OrdinalOperation::InscriptionRevealed(ref mut inscription_data) = block.transactions[tx_index].metadata.ordinal_operations[op_index] else {
475+
continue;
476+
};
477+
let is_curse = inscription_data.curse_type.is_some();
478+
let inscription_number = sequence_cursor.pick_next(is_curse, block.block_identifier.index);
479+
inscription_data.inscription_number = inscription_number;
480+
481+
if is_curse {
482+
sequence_cursor.increment_cursed();
483+
} else {
484+
sequence_cursor.increment_blessed();
485+
};
486+
487+
ctx.try_log(|logger| {
488+
info!(
489+
logger,
490+
"Unbound inscription {} (#{}) detected on Satoshi {} (block {}, {} transfers)",
491+
inscription_data.inscription_id,
492+
inscription_data.inscription_number,
493+
inscription_data.ordinal_number,
494+
block.block_identifier.index,
495+
inscription_data.transfers_pre_inscription,
496+
);
497+
});
475498
}
476499
any_event
477500
}

0 commit comments

Comments
 (0)