mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-30 20:28:11 -07:00
global: big snapshot part 2
This commit is contained in:
@@ -3,12 +3,12 @@ use brk_types::{Indexes, Sats};
|
||||
use vecdb::{Exit, VecIndex};
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{mining, prices, scripts};
|
||||
use crate::{mining, outputs, prices};
|
||||
|
||||
impl Vecs {
|
||||
pub(crate) fn compute(
|
||||
&mut self,
|
||||
scripts: &scripts::Vecs,
|
||||
outputs: &outputs::Vecs,
|
||||
mining: &mining::Vecs,
|
||||
prices: &prices::Vecs,
|
||||
starting_indexes: &Indexes,
|
||||
@@ -18,7 +18,7 @@ impl Vecs {
|
||||
.compute_with(starting_indexes.height, prices, exit, |sats| {
|
||||
Ok(sats.compute_transform2(
|
||||
starting_indexes.height,
|
||||
&scripts.value.op_return.block.sats,
|
||||
&outputs.value.op_return.block.sats,
|
||||
&mining.rewards.unclaimed.block.sats,
|
||||
|(h, op_return, unclaimed, ..)| {
|
||||
let genesis = if h.to_usize() == 0 {
|
||||
|
||||
@@ -6,13 +6,13 @@ use vecdb::Exit;
|
||||
const INITIAL_SUBSIDY: f64 = Sats::ONE_BTC_U64 as f64 * 50.0;
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{blocks, distribution, mining, prices, scripts, transactions};
|
||||
use crate::{blocks, distribution, mining, outputs, prices, transactions};
|
||||
|
||||
impl Vecs {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub(crate) fn compute(
|
||||
&mut self,
|
||||
scripts: &scripts::Vecs,
|
||||
outputs: &outputs::Vecs,
|
||||
blocks: &blocks::Vecs,
|
||||
mining: &mining::Vecs,
|
||||
transactions: &transactions::Vecs,
|
||||
@@ -25,7 +25,7 @@ impl Vecs {
|
||||
|
||||
// 1. Compute burned/unspendable supply
|
||||
self.burned
|
||||
.compute(scripts, mining, prices, starting_indexes, exit)?;
|
||||
.compute(outputs, mining, prices, starting_indexes, exit)?;
|
||||
|
||||
// 2. Compute inflation rate: (supply[h] / supply[1y_ago]) - 1
|
||||
// Skip when lookback supply <= first block (50 BTC = 5B sats),
|
||||
|
||||
Reference in New Issue
Block a user