Skip to content

Commit

Permalink
fix: potential resolve coinbase spent
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru committed Jul 7, 2023
1 parent b354ce1 commit 5d26738
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/hord-cli/src/hord/mod.rs
Expand Up @@ -668,7 +668,7 @@ pub fn update_storage_and_augment_bitcoin_block_with_inscription_transfer_data(
) -> Result<bool, String> {
let mut storage_updated = false;
let mut cumulated_fees = 0;
let first_sat_post_subsidy = Height(block.block_identifier.index).starting_sat().0;
let subsidy = Height(block.block_identifier.index).subsidy();
let coinbase_txid = &block.transactions[0].transaction_identifier.clone();
let network = match block.metadata.network {
BitcoinNetwork::Mainnet => Network::Bitcoin,
Expand Down Expand Up @@ -780,19 +780,19 @@ pub fn update_storage_and_augment_bitcoin_block_with_inscription_transfer_data(
}
SatPosition::Fee(offset) => {
// Get Coinbase TX
let offset = first_sat_post_subsidy + cumulated_fees + offset;
let total_offset = subsidy + cumulated_fees + offset;
let outpoint = format_outpoint_to_watch(&coinbase_txid, 0);
ctx.try_log(|logger| {
slog::info!(
logger,
"Inscription {} spent in fees ({}+{}+{})",
watched_satpoint.inscription_id,
first_sat_post_subsidy,
subsidy,
cumulated_fees,
offset
)
});
(outpoint, offset, None, None)
(outpoint, total_offset, None, None)
}
};

Expand Down

0 comments on commit 5d26738

Please sign in to comment.