mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-26 18:28:11 -07:00
global: big snapshot
This commit is contained in:
@@ -3,23 +3,20 @@ use brk_types::{Bitcoin, CheckedSub, Indexes, StoredF64};
|
||||
use vecdb::Exit;
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{blocks, distribution};
|
||||
use crate::distribution;
|
||||
|
||||
impl Vecs {
|
||||
pub(crate) fn compute(
|
||||
&mut self,
|
||||
starting_indexes: &Indexes,
|
||||
blocks: &blocks::Vecs,
|
||||
distribution: &distribution::Vecs,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
let window_starts = blocks.lookback.window_starts();
|
||||
|
||||
let all_metrics = &distribution.utxo_cohorts.all.metrics;
|
||||
let circulating_supply = &all_metrics.supply.total.sats.height;
|
||||
|
||||
self.coinblocks_created
|
||||
.compute(starting_indexes.height, &window_starts, exit, |vec| {
|
||||
.compute(starting_indexes.height, exit, |vec| {
|
||||
vec.compute_transform(
|
||||
starting_indexes.height,
|
||||
circulating_supply,
|
||||
@@ -30,7 +27,7 @@ impl Vecs {
|
||||
})?;
|
||||
|
||||
self.coinblocks_stored
|
||||
.compute(starting_indexes.height, &window_starts, exit, |vec| {
|
||||
.compute(starting_indexes.height, exit, |vec| {
|
||||
vec.compute_subtract(
|
||||
starting_indexes.height,
|
||||
&self.coinblocks_created.raw.height,
|
||||
|
||||
Reference in New Issue
Block a user