mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 06:39:58 -07:00
global: veccached change
This commit is contained in:
@@ -38,10 +38,10 @@ impl Vecs {
|
||||
|
||||
let hash_rate = &self.rate.base.height;
|
||||
for (sma, window) in [
|
||||
(&mut self.rate.sma._1w.height, &lookback._1w),
|
||||
(&mut self.rate.sma._1m.height, &lookback._1m),
|
||||
(&mut self.rate.sma._1w.height, &lookback._1w.inner),
|
||||
(&mut self.rate.sma._1m.height, &lookback._1m.inner),
|
||||
(&mut self.rate.sma._2m.height, &lookback._2m),
|
||||
(&mut self.rate.sma._1y.height, &lookback._1y),
|
||||
(&mut self.rate.sma._1y.height, &lookback._1y.inner),
|
||||
] {
|
||||
sma.compute_rolling_average(starting_indexes.height, window, hash_rate, exit)?;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ use brk_types::Version;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{
|
||||
CachedWindowStarts,
|
||||
WindowStartVec, Windows,
|
||||
db_utils::{finalize_db, open_db},
|
||||
},
|
||||
};
|
||||
@@ -18,7 +18,7 @@ impl Vecs {
|
||||
parent_path: &Path,
|
||||
parent_version: Version,
|
||||
indexes: &indexes::Vecs,
|
||||
cached_starts: &CachedWindowStarts,
|
||||
cached_starts: &Windows<&WindowStartVec>,
|
||||
) -> Result<Self> {
|
||||
let db = open_db(parent_path, super::DB_NAME, 1_000_000)?;
|
||||
let version = parent_version;
|
||||
|
||||
@@ -7,8 +7,8 @@ use crate::{
|
||||
indexes,
|
||||
internal::{
|
||||
AmountPerBlockCumulative, AmountPerBlockCumulativeRolling, AmountPerBlockFull,
|
||||
CachedWindowStarts, LazyPercentRollingWindows, OneMinusBp16, PercentPerBlock,
|
||||
PercentRollingWindows, RatioRollingWindows,
|
||||
LazyPercentRollingWindows, OneMinusBp16, PercentPerBlock, PercentRollingWindows,
|
||||
RatioRollingWindows, WindowStartVec, Windows,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@ impl Vecs {
|
||||
db: &Database,
|
||||
version: Version,
|
||||
indexes: &indexes::Vecs,
|
||||
cached_starts: &CachedWindowStarts,
|
||||
cached_starts: &Windows<&WindowStartVec>,
|
||||
) -> Result<Self> {
|
||||
let fee_dominance_rolling =
|
||||
PercentRollingWindows::forced_import(db, "fee_dominance", version, indexes)?;
|
||||
|
||||
Reference in New Issue
Block a user