Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove index parameter from index_block #3088

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/index/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ impl<'index> Updater<'_> {
let mut value_cache = HashMap::new();
while let Ok(block) = rx.recv() {
self.index_block(
self.index,
&mut outpoint_sender,
&mut value_receiver,
&mut wtx,
Expand Down Expand Up @@ -312,7 +311,6 @@ impl<'index> Updater<'_> {

fn index_block(
&mut self,
index: &Index,
outpoint_sender: &mut Sender<OutPoint>,
value_receiver: &mut Receiver<u64>,
wtx: &mut WriteTransaction,
Expand Down Expand Up @@ -340,8 +338,8 @@ impl<'index> Updater<'_> {

let mut outpoint_to_value = wtx.open_table(OUTPOINT_TO_VALUE)?;

let index_inscriptions =
self.height >= index.first_inscription_height && !index.options.no_index_inscriptions;
let index_inscriptions = self.height >= self.index.first_inscription_height
&& !self.index.options.no_index_inscriptions;

if index_inscriptions {
// Send all missing input outpoints to be fetched right away
Expand Down Expand Up @@ -471,7 +469,7 @@ impl<'index> Updater<'_> {
for input in &tx.input {
let key = input.previous_output.store();

let sat_ranges = match if index.index_spent_sats {
let sat_ranges = match if self.index.index_spent_sats {
self.range_cache.get(&key).cloned()
} else {
self.range_cache.remove(&key)
Expand All @@ -480,7 +478,7 @@ impl<'index> Updater<'_> {
self.outputs_cached += 1;
sat_ranges
}
None => if index.index_spent_sats {
None => if self.index.index_spent_sats {
outpoint_to_sat_ranges.get(&key)?
} else {
outpoint_to_sat_ranges.remove(&key)?
Expand Down Expand Up @@ -582,7 +580,7 @@ impl<'index> Updater<'_> {
&inscription_updater.unbound_inscriptions,
)?;

if index.index_runes && self.height >= self.index.options.first_rune_height() {
if self.index.index_runes && self.height >= self.index.options.first_rune_height() {
let mut outpoint_to_rune_balances = wtx.open_table(OUTPOINT_TO_RUNE_BALANCES)?;
let mut rune_id_to_rune_entry = wtx.open_table(RUNE_ID_TO_RUNE_ENTRY)?;
let mut rune_to_rune_id = wtx.open_table(RUNE_TO_RUNE_ID)?;
Expand Down
Loading