mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-28 08:39:59 -07:00
global: snapshot
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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>,
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
)?;
|
||||
|
||||
Reference in New Issue
Block a user