mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-28 08:39:59 -07:00
global: snapshot
This commit is contained in:
@@ -27,17 +27,16 @@ impl Vecs {
|
||||
self.versions
|
||||
.compute(indexer, &blocks.count, starting_indexes, exit)?;
|
||||
|
||||
// Size computes next (uses BlockWindowStarts for 1h/24h rolling)
|
||||
// Size computes next (uses 6-block rolling window)
|
||||
self.size
|
||||
.compute(indexer, indexes, &blocks.count, starting_indexes, exit)?;
|
||||
.compute(indexer, indexes, starting_indexes, exit)?;
|
||||
|
||||
// Fees depends on size, blocks (window starts)
|
||||
// Fees depends on size
|
||||
self.fees.compute(
|
||||
indexer,
|
||||
indexes,
|
||||
inputs,
|
||||
&self.size,
|
||||
blocks,
|
||||
starting_indexes,
|
||||
exit,
|
||||
)?;
|
||||
|
||||
@@ -5,7 +5,7 @@ use vecdb::{Exit, unlikely};
|
||||
|
||||
use super::super::size;
|
||||
use super::Vecs;
|
||||
use crate::{ComputeIndexes, blocks, indexes, inputs};
|
||||
use crate::{ComputeIndexes, indexes, inputs};
|
||||
|
||||
impl Vecs {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
@@ -15,7 +15,6 @@ impl Vecs {
|
||||
indexes: &indexes::Vecs,
|
||||
txins: &inputs::Vecs,
|
||||
size_vecs: &size::Vecs,
|
||||
blocks: &blocks::Vecs,
|
||||
starting_indexes: &ComputeIndexes,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
@@ -58,14 +57,11 @@ impl Vecs {
|
||||
exit,
|
||||
)?;
|
||||
|
||||
let block_windows = blocks.count.block_window_starts();
|
||||
|
||||
// Skip coinbase (first tx per block) since it has fee=0
|
||||
self.fee.derive_from_with_skip(
|
||||
indexer,
|
||||
indexes,
|
||||
starting_indexes,
|
||||
&block_windows,
|
||||
exit,
|
||||
1,
|
||||
)?;
|
||||
@@ -75,7 +71,6 @@ impl Vecs {
|
||||
indexer,
|
||||
indexes,
|
||||
starting_indexes,
|
||||
&block_windows,
|
||||
exit,
|
||||
1,
|
||||
)?;
|
||||
|
||||
@@ -3,24 +3,21 @@ use brk_indexer::Indexer;
|
||||
use vecdb::Exit;
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{blocks, indexes, ComputeIndexes};
|
||||
use crate::{indexes, ComputeIndexes};
|
||||
|
||||
impl Vecs {
|
||||
pub(crate) fn compute(
|
||||
&mut self,
|
||||
indexer: &Indexer,
|
||||
indexes: &indexes::Vecs,
|
||||
count_vecs: &blocks::CountVecs,
|
||||
starting_indexes: &ComputeIndexes,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
let block_windows = count_vecs.block_window_starts();
|
||||
|
||||
self.weight
|
||||
.derive_from(indexer, indexes, starting_indexes, &block_windows, exit)?;
|
||||
.derive_from(indexer, indexes, starting_indexes, exit)?;
|
||||
|
||||
self.vsize
|
||||
.derive_from(indexer, indexes, starting_indexes, &block_windows, exit)?;
|
||||
.derive_from(indexer, indexes, starting_indexes, exit)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user