global: snapshot

This commit is contained in:
nym21
2026-03-10 23:24:18 +01:00
parent 6a728a3357
commit c5d63b3090
75 changed files with 873 additions and 791 deletions

View File

@@ -23,7 +23,7 @@ impl Query {
let blockhash = indexer.vecs.blocks.blockhash.read_once(height)?;
let difficulty = indexer.vecs.blocks.difficulty.collect_one(height).unwrap();
let timestamp = indexer.vecs.blocks.timestamp.collect_one(height).unwrap();
let size = indexer.vecs.blocks.total_size.collect_one(height).unwrap();
let size = indexer.vecs.blocks.total.collect_one(height).unwrap();
let weight = indexer.vecs.blocks.weight.collect_one(height).unwrap();
let tx_count = self.tx_count_at_height(height, max_height)?;
@@ -61,7 +61,7 @@ impl Query {
let difficulties = indexer.vecs.blocks.difficulty.collect_range_at(begin, end);
let timestamps = indexer.vecs.blocks.timestamp.collect_range_at(begin, end);
let sizes = indexer.vecs.blocks.total_size.collect_range_at(begin, end);
let sizes = indexer.vecs.blocks.total.collect_range_at(begin, end);
let weights = indexer.vecs.blocks.weight.collect_range_at(begin, end);
// Batch-read first_txindex for tx_count computation (need one extra for next boundary)

View File

@@ -21,7 +21,7 @@ impl Query {
}
let position = computer.positions.block.collect_one(height).unwrap();
let size = indexer.vecs.blocks.total_size.collect_one(height).unwrap();
let size = indexer.vecs.blocks.total.collect_one(height).unwrap();
reader.read_raw_bytes(position, *size as usize)
}

View File

@@ -30,7 +30,7 @@ impl Query {
let current_hashrate = *computer
.mining
.hashrate
.hash_rate
.rate.raw
.day1
.collect_one_flat(current_day1)
.unwrap_or_default() as u128;
@@ -55,7 +55,7 @@ impl Query {
let total_days = end_day1.to_usize().saturating_sub(start_day1.to_usize()) + 1;
let step = (total_days / 200).max(1); // Max ~200 data points
let hashrate_vec = &computer.mining.hashrate.hash_rate.day1;
let hashrate_vec = &computer.mining.hashrate.rate.raw.day1;
let timestamp_vec = &computer.blocks.time.timestamp.day1;
let mut hashrates = Vec::with_capacity(total_days / step + 1);

View File

@@ -14,7 +14,7 @@ impl Query {
let coinbase_vec = &computer.mining.rewards.coinbase.base.sats.height;
let fee_vec = &computer.mining.rewards.fees.base.sats.height;
let tx_count_vec = &computer.transactions.count.tx_count.raw.height;
let tx_count_vec = &computer.transactions.count.total.raw.height;
let start = start_block.to_usize();
let end = end_block.to_usize() + 1;