mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-12 03:28:13 -07:00
global: big snapshot
This commit is contained in:
@@ -5,13 +5,10 @@ use vecdb::Exit;
|
||||
|
||||
use super::Vecs;
|
||||
|
||||
use crate::blocks::lookback;
|
||||
|
||||
impl Vecs {
|
||||
pub(crate) fn compute(
|
||||
&mut self,
|
||||
indexer: &Indexer,
|
||||
lookback: &lookback::Vecs,
|
||||
starting_indexes: &Indexes,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
@@ -22,20 +19,7 @@ impl Vecs {
|
||||
|h| (h, StoredU32::from(1_u32)),
|
||||
exit,
|
||||
)?;
|
||||
self.total.cumulative.height.compute_cumulative(
|
||||
starting_indexes.height,
|
||||
&self.total.raw.height,
|
||||
exit,
|
||||
)?;
|
||||
|
||||
// Rolling window block counts
|
||||
let ws = lookback.window_starts();
|
||||
self.total.sum.compute_rolling_sum(
|
||||
starting_indexes.height,
|
||||
&ws,
|
||||
&self.total.raw.height,
|
||||
exit,
|
||||
)?;
|
||||
self.total.compute_rest(starting_indexes.height, exit)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user