mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-09 10:08:13 -07:00
global: snapshot
This commit is contained in:
@@ -43,7 +43,7 @@ impl Vecs {
|
||||
)?;
|
||||
|
||||
// Compute blocks before next adjustment
|
||||
self.blocks_before_next_adjustment
|
||||
self.blocks_before_next
|
||||
.height
|
||||
.compute_transform(
|
||||
starting_indexes.height,
|
||||
@@ -53,9 +53,9 @@ impl Vecs {
|
||||
)?;
|
||||
|
||||
// Compute days before next adjustment
|
||||
self.days_before_next_adjustment.height.compute_transform(
|
||||
self.days_before_next.height.compute_transform(
|
||||
starting_indexes.height,
|
||||
&self.blocks_before_next_adjustment.height,
|
||||
&self.blocks_before_next.height,
|
||||
|(h, blocks, ..)| (h, (*blocks as f32 / TARGET_BLOCKS_PER_DAY_F32).into()),
|
||||
exit,
|
||||
)?;
|
||||
|
||||
@@ -33,13 +33,13 @@ impl Vecs {
|
||||
indexes,
|
||||
)?,
|
||||
epoch: ComputedPerBlock::forced_import(db, "difficulty_epoch", version, indexes)?,
|
||||
blocks_before_next_adjustment: ComputedPerBlock::forced_import(
|
||||
blocks_before_next: ComputedPerBlock::forced_import(
|
||||
db,
|
||||
"blocks_before_next_difficulty_adjustment",
|
||||
version + v2,
|
||||
indexes,
|
||||
)?,
|
||||
days_before_next_adjustment: ComputedPerBlock::forced_import(
|
||||
days_before_next: ComputedPerBlock::forced_import(
|
||||
db,
|
||||
"days_before_next_difficulty_adjustment",
|
||||
version + v2,
|
||||
|
||||
@@ -9,6 +9,6 @@ pub struct Vecs<M: StorageMode = Rw> {
|
||||
pub as_hash: ComputedPerBlock<StoredF64, M>,
|
||||
pub adjustment: PercentPerBlock<BasisPointsSigned32, M>,
|
||||
pub epoch: ComputedPerBlock<Epoch, M>,
|
||||
pub blocks_before_next_adjustment: ComputedPerBlock<StoredU32, M>,
|
||||
pub days_before_next_adjustment: ComputedPerBlock<StoredF32, M>,
|
||||
pub blocks_before_next: ComputedPerBlock<StoredU32, M>,
|
||||
pub days_before_next: ComputedPerBlock<StoredF32, M>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user