Skip to content

Commit

Permalink
feat: re-implement satoshi overflows handling
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru committed Aug 4, 2023
1 parent 04c5f37 commit 8ea5bdf
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions components/hord-cli/src/core/protocol/inscription_sequencing.rs
Expand Up @@ -470,8 +470,31 @@ pub fn augment_block_with_ordinals_inscriptions_data(
}

// Handle sats overflow
while let Some(sats_overlow) = sats_overflows.pop_front() {
// TODO
while let Some((tx_index, op_index)) = sats_overflows.pop_front() {
let OrdinalOperation::InscriptionRevealed(ref mut inscription_data) = block.transactions[tx_index].metadata.ordinal_operations[op_index] else {
continue;
};
let is_curse = inscription_data.curse_type.is_some();
let inscription_number = sequence_cursor.pick_next(is_curse, block.block_identifier.index);
inscription_data.inscription_number = inscription_number;

if is_curse {
sequence_cursor.increment_cursed();
} else {
sequence_cursor.increment_blessed();
};

ctx.try_log(|logger| {
info!(
logger,
"Unbound inscription {} (#{}) detected on Satoshi {} (block {}, {} transfers)",
inscription_data.inscription_id,
inscription_data.inscription_number,
inscription_data.ordinal_number,
block.block_identifier.index,
inscription_data.transfers_pre_inscription,
);
});
}
any_event
}
Expand Down

0 comments on commit 8ea5bdf

Please sign in to comment.