diff --git a/zebra-state/src/service/finalized_state/disk_db.rs b/zebra-state/src/service/finalized_state/disk_db.rs index 1466b5cc67c..b5095d22192 100644 --- a/zebra-state/src/service/finalized_state/disk_db.rs +++ b/zebra-state/src/service/finalized_state/disk_db.rs @@ -32,9 +32,6 @@ use crate::{ Config, }; -#[cfg(not(feature = "indexer"))] -use crate::constants::STATE_DATABASE_KIND; - // Doc-only imports #[allow(unused_imports)] use super::{TypedColumnFamily, WriteTypedBatch}; diff --git a/zebra-state/src/service/finalized_state/disk_format/upgrade/drop_tx_locs_by_spends.rs b/zebra-state/src/service/finalized_state/disk_format/upgrade/drop_tx_locs_by_spends.rs index fa53d397052..cfc82b1aec1 100644 --- a/zebra-state/src/service/finalized_state/disk_format/upgrade/drop_tx_locs_by_spends.rs +++ b/zebra-state/src/service/finalized_state/disk_format/upgrade/drop_tx_locs_by_spends.rs @@ -42,7 +42,12 @@ pub fn run( let height = Height(height); let mut batch = DiskWriteBatch::new(); - for (_tx_loc, tx) in zebra_db.transactions_by_height(height) { + let transactions = zebra_db.transactions_by_location_range( + crate::TransactionLocation::from_index(height, 1) + ..=crate::TransactionLocation::max_for_height(height), + ); + + for (_tx_loc, tx) in transactions { if tx.is_coinbase() { continue; } diff --git a/zebra-state/src/service/finalized_state/disk_format/upgrade/track_tx_locs_by_spends.rs b/zebra-state/src/service/finalized_state/disk_format/upgrade/track_tx_locs_by_spends.rs index 175d670d69b..be754fac452 100644 --- a/zebra-state/src/service/finalized_state/disk_format/upgrade/track_tx_locs_by_spends.rs +++ b/zebra-state/src/service/finalized_state/disk_format/upgrade/track_tx_locs_by_spends.rs @@ -35,7 +35,12 @@ pub fn run( let mut batch = DiskWriteBatch::new(); let mut should_index_at_height = false; - for (tx_loc, tx) in zebra_db.transactions_by_height(height) { + let transactions = zebra_db.transactions_by_location_range( + crate::TransactionLocation::from_index(height, 1) + ..=crate::TransactionLocation::max_for_height(height), + ); + + for (tx_loc, tx) in transactions { if tx.is_coinbase() { continue; }