Skip to content

Commit f86b184

Browse files
author
Ludo Galabru
committed
fix: handle hint and case of re-inscriptions
1 parent 9de3a0f commit f86b184

File tree

2 files changed

+28
-17
lines changed

2 files changed

+28
-17
lines changed

components/hord-cli/src/hord/mod.rs

+14-3
Original file line numberDiff line numberDiff line change
@@ -1629,9 +1629,11 @@ pub fn update_storage_and_augment_bitcoin_block_with_inscription_reveal_data_tx(
16291629

16301630
let mut latest_cursed_inscription_loaded = false;
16311631
let mut latest_cursed_inscription_number = 0;
1632+
let mut cursed_inscription_sequence_updated = false;
16321633

16331634
let mut latest_blessed_inscription_loaded = false;
16341635
let mut latest_blessed_inscription_number = 0;
1636+
let mut blessed_inscription_sequence_updated = false;
16351637

16361638
let mut sats_overflow = vec![];
16371639

@@ -1772,7 +1774,11 @@ pub fn update_storage_and_augment_bitcoin_block_with_inscription_reveal_data_tx(
17721774
);
17731775
});
17741776
insert_entry_in_inscriptions(&inscription, &block.block_identifier, &transaction, &ctx);
1775-
1777+
if inscription.curse_type.is_some() {
1778+
cursed_inscription_sequence_updated = true;
1779+
} else {
1780+
blessed_inscription_sequence_updated = true;
1781+
}
17761782
storage_updated = true;
17771783
}
17781784

@@ -1797,12 +1803,17 @@ pub fn update_storage_and_augment_bitcoin_block_with_inscription_reveal_data_tx(
17971803
insert_entry_in_inscriptions(&inscription, &block.block_identifier, &transaction, &ctx);
17981804
latest_blessed_inscription_number += 1;
17991805
storage_updated = true;
1806+
if inscription.curse_type.is_some() {
1807+
cursed_inscription_sequence_updated = true;
1808+
} else {
1809+
blessed_inscription_sequence_updated = true;
1810+
}
18001811
}
18011812

1802-
if latest_cursed_inscription_loaded {
1813+
if cursed_inscription_sequence_updated {
18031814
inscription_height_hint.cursed = Some(block.block_identifier.index);
18041815
}
1805-
if latest_blessed_inscription_loaded {
1816+
if blessed_inscription_sequence_updated {
18061817
inscription_height_hint.blessed = Some(block.block_identifier.index);
18071818
}
18081819

components/hord-cli/src/service/mod.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,20 @@ impl Service {
6666
// std::thread::sleep(std::time::Duration::from_secs(3600000));
6767

6868
// Force rebuild
69-
// {
70-
// let blocks_db =
71-
// open_readwrite_hord_db_conn_rocks_db(&self.config.expected_cache_path(), &self.ctx)?;
72-
// let inscriptions_db_conn_rw =
73-
// open_readwrite_hord_db_conn(&self.config.expected_cache_path(), &self.ctx)?;
74-
75-
// delete_data_in_hord_db(
76-
// 767430,
77-
// 800000,
78-
// &blocks_db,
79-
// &inscriptions_db_conn_rw,
80-
// &self.ctx,
81-
// )?;
82-
// }
69+
{
70+
let blocks_db =
71+
open_readwrite_hord_db_conn_rocks_db(&self.config.expected_cache_path(), &self.ctx)?;
72+
let inscriptions_db_conn_rw =
73+
open_readwrite_hord_db_conn(&self.config.expected_cache_path(), &self.ctx)?;
74+
75+
delete_data_in_hord_db(
76+
767430,
77+
800000,
78+
&blocks_db,
79+
&inscriptions_db_conn_rw,
80+
&self.ctx,
81+
)?;
82+
}
8383

8484
// rebuild_rocks_db(&self.config, 767400, 767429, 767400, None, &self.ctx).await?;
8585

0 commit comments

Comments
 (0)