global: snapshot

This commit is contained in:
nym21
2026-03-10 23:24:18 +01:00
parent 6a728a3357
commit c5d63b3090
75 changed files with 873 additions and 791 deletions

View File

@@ -15,7 +15,7 @@ impl Vecs {
exit: &Exit,
) -> Result<()> {
let window_starts = lookback.window_starts();
self.tx_count
self.total
.compute(starting_indexes.height, &window_starts, exit, |height| {
Ok(height.compute_count_from_indexes(
starting_indexes.height,

View File

@@ -26,7 +26,7 @@ impl Vecs {
);
Ok(Self {
tx_count: ComputedPerBlockFull::forced_import(db, "tx_count", version, indexes)?,
total: ComputedPerBlockFull::forced_import(db, "tx_count", version, indexes)?,
is_coinbase: txindex_to_is_coinbase,
})
}

View File

@@ -6,6 +6,6 @@ use crate::internal::ComputedPerBlockFull;
#[derive(Traversable)]
pub struct Vecs<M: StorageMode = Rw> {
pub tx_count: ComputedPerBlockFull<StoredU64, M>,
pub total: ComputedPerBlockFull<StoredU64, M>,
pub is_coinbase: LazyVecFrom2<TxIndex, StoredBool, TxIndex, Height, Height, TxIndex>,
}

View File

@@ -71,7 +71,7 @@ impl Vecs {
.height
.compute_binary::<_, Timestamp, PerSec>(
starting_indexes.height,
&count_vecs.tx_count.raw.height,
&count_vecs.total.raw.height,
&blocks.interval.height,
exit,
)?;
@@ -87,7 +87,7 @@ impl Vecs {
.height
.compute_binary::<_, Timestamp, PerSec>(
starting_indexes.height,
&outputs_count.total_count.full.sum,
&outputs_count.total.full.sum,
&blocks.interval.height,
exit,
)?;