mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 22:59:58 -07:00
global: snapshot
This commit is contained in:
@@ -11,7 +11,7 @@ impl Query {
|
||||
let current_height = self.height().to_usize();
|
||||
let start = current_height.saturating_sub(time_period.block_count());
|
||||
|
||||
let coinbase_vec = &computer.mining.rewards.coinbase.raw.sats.height;
|
||||
let coinbase_vec = &computer.mining.rewards.coinbase.base.sats.height;
|
||||
let timestamp_vec = &indexer.vecs.blocks.timestamp;
|
||||
|
||||
match time_period {
|
||||
|
||||
@@ -23,7 +23,7 @@ pub fn iter_difficulty_epochs(
|
||||
|
||||
let epoch_to_height = &computer.indexes.epoch.first_height;
|
||||
let epoch_to_timestamp = &computer.blocks.time.timestamp.epoch;
|
||||
let epoch_to_difficulty = &computer.blocks.difficulty.raw.epoch;
|
||||
let epoch_to_difficulty = &computer.blocks.difficulty.base.epoch;
|
||||
|
||||
let mut results = Vec::with_capacity(end_epoch.to_usize() - start_epoch.to_usize() + 1);
|
||||
let mut prev_difficulty: Option<f64> = None;
|
||||
|
||||
@@ -30,7 +30,7 @@ impl Query {
|
||||
let current_hashrate = *computer
|
||||
.mining
|
||||
.hashrate
|
||||
.rate.raw
|
||||
.rate.base
|
||||
.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.rate.raw.day1;
|
||||
let hashrate_vec = &computer.mining.hashrate.rate.base.day1;
|
||||
let timestamp_vec = &computer.blocks.time.timestamp.day1;
|
||||
|
||||
let mut hashrates = Vec::with_capacity(total_days / step + 1);
|
||||
|
||||
@@ -12,9 +12,9 @@ impl Query {
|
||||
let end_block = current_height;
|
||||
let start_block = Height::from(current_height.to_usize().saturating_sub(block_count - 1));
|
||||
|
||||
let coinbase_vec = &computer.mining.rewards.coinbase.raw.sats.height;
|
||||
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.total.raw.height;
|
||||
let tx_count_vec = &computer.transactions.count.total.base.height;
|
||||
|
||||
let start = start_block.to_usize();
|
||||
let end = end_block.to_usize() + 1;
|
||||
|
||||
Reference in New Issue
Block a user