Skip to content

Commit

Permalink
Fixes lint, avoids reading coinbase transactions from disk
Browse files Browse the repository at this point in the history
  • Loading branch information
arya2 committed Oct 25, 2024
1 parent 14a225e commit dfd99ab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 0 additions & 3 deletions zebra-state/src/service/finalized_state/disk_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit dfd99ab

Please sign in to comment.