mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 22:59:58 -07:00
global: snapshot
This commit is contained in:
@@ -102,12 +102,12 @@ impl Vecs {
|
||||
)?)
|
||||
})?;
|
||||
|
||||
self.opreturn
|
||||
self.op_return
|
||||
.compute(starting_indexes.height, exit, |v| {
|
||||
Ok(v.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.scripts.opreturn.first_index,
|
||||
&indexer.vecs.scripts.opreturn.to_tx_index,
|
||||
&indexer.vecs.scripts.op_return.first_index,
|
||||
&indexer.vecs.scripts.op_return.to_tx_index,
|
||||
exit,
|
||||
)?)
|
||||
})?;
|
||||
|
||||
@@ -46,9 +46,9 @@ impl Vecs {
|
||||
p2tr,
|
||||
p2wpkh,
|
||||
p2wsh,
|
||||
opreturn: PerBlockCumulativeWithSums::forced_import(
|
||||
op_return: PerBlockCumulativeWithSums::forced_import(
|
||||
db,
|
||||
"opreturn_count",
|
||||
"op_return_count",
|
||||
version,
|
||||
indexes,
|
||||
cached_starts,
|
||||
|
||||
@@ -15,7 +15,7 @@ pub struct Vecs<M: StorageMode = Rw> {
|
||||
pub p2tr: PerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
pub p2wpkh: PerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
pub p2wsh: PerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
pub opreturn: PerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
pub op_return: PerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
pub empty_output: PerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
pub unknown_output: PerBlockCumulativeWithSums<StoredU64, StoredU64, M>,
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ impl Vecs {
|
||||
starting_indexes: &Indexes,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
self.opreturn.compute_with(
|
||||
self.op_return.compute_with(
|
||||
starting_indexes.height,
|
||||
prices,
|
||||
exit,
|
||||
@@ -81,14 +81,14 @@ impl Vecs {
|
||||
.value
|
||||
.collect_range_into_at(out_start, out_end, &mut values_buf);
|
||||
|
||||
let mut opreturn_value = Sats::ZERO;
|
||||
let mut op_return_value = Sats::ZERO;
|
||||
for (ot, val) in output_types_buf.iter().zip(values_buf.iter()) {
|
||||
if *ot == OutputType::OpReturn {
|
||||
opreturn_value += *val;
|
||||
op_return_value += *val;
|
||||
}
|
||||
}
|
||||
|
||||
height_vec.truncate_push(height, opreturn_value)?;
|
||||
height_vec.truncate_push(height, op_return_value)?;
|
||||
}
|
||||
|
||||
height_vec.write()?;
|
||||
|
||||
@@ -12,9 +12,9 @@ impl Vecs {
|
||||
indexes: &indexes::Vecs,
|
||||
) -> Result<Self> {
|
||||
Ok(Self {
|
||||
opreturn: AmountPerBlockCumulative::forced_import(
|
||||
op_return: AmountPerBlockCumulative::forced_import(
|
||||
db,
|
||||
"opreturn_value",
|
||||
"op_return_value",
|
||||
version,
|
||||
indexes,
|
||||
)?,
|
||||
|
||||
@@ -5,5 +5,5 @@ use crate::internal::AmountPerBlockCumulative;
|
||||
|
||||
#[derive(Traversable)]
|
||||
pub struct Vecs<M: StorageMode = Rw> {
|
||||
pub opreturn: AmountPerBlockCumulative<M>,
|
||||
pub op_return: AmountPerBlockCumulative<M>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user