mirror of
https://github.com/alexgo-io/bitcoin-indexer.git
synced 2026-01-12 16:52:57 +08:00
fix: calculate charms correctly when inscription is unbound (#440)
This commit is contained in:
@@ -550,6 +550,15 @@ async fn update_tx_inscriptions_with_consensus_sequence_data(
|
|||||||
None => inscription.curse_type.take(),
|
None => inscription.curse_type.take(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inscription.charms |= Sat(traversal.ordinal_number).charms();
|
||||||
|
if is_cursed {
|
||||||
|
if block_identifier.index >= get_jubilee_block_height(network) {
|
||||||
|
Charm::Vindicated.set(&mut inscription.charms);
|
||||||
|
} else {
|
||||||
|
Charm::Cursed.set(&mut inscription.charms);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let (destination, satpoint_post_transfer, output_value) = compute_satpoint_post_transfer(
|
let (destination, satpoint_post_transfer, output_value) = compute_satpoint_post_transfer(
|
||||||
&&*tx,
|
&&*tx,
|
||||||
input_index,
|
input_index,
|
||||||
@@ -588,14 +597,7 @@ async fn update_tx_inscriptions_with_consensus_sequence_data(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inscription.charms |= Sat(traversal.ordinal_number).charms();
|
if !is_cursed {
|
||||||
if is_cursed {
|
|
||||||
if block_identifier.index >= get_jubilee_block_height(network) {
|
|
||||||
Charm::Vindicated.set(&mut inscription.charms);
|
|
||||||
} else {
|
|
||||||
Charm::Cursed.set(&mut inscription.charms);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// The reinscriptions_data needs to be augmented as we go, to handle transaction chaining.
|
// The reinscriptions_data needs to be augmented as we go, to handle transaction chaining.
|
||||||
reinscriptions_data.insert(traversal.ordinal_number, traversal.get_inscription_id());
|
reinscriptions_data.insert(traversal.ordinal_number, traversal.get_inscription_id());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user