mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-30 09:30:00 -07:00
global: renames part 2
This commit is contained in:
@@ -19,7 +19,7 @@ impl Vecs {
|
||||
.compute(starting_indexes.height, &window_starts, exit, |height| {
|
||||
Ok(height.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.transactions.first_txindex,
|
||||
&indexer.vecs.transactions.first_tx_index,
|
||||
&indexer.vecs.transactions.txid,
|
||||
exit,
|
||||
)?)
|
||||
|
||||
@@ -14,16 +14,16 @@ impl Vecs {
|
||||
indexes: &indexes::Vecs,
|
||||
cached_starts: &CachedWindowStarts,
|
||||
) -> Result<Self> {
|
||||
let txindex_to_is_coinbase = LazyVecFrom2::init(
|
||||
let tx_index_to_is_coinbase = LazyVecFrom2::init(
|
||||
"is_coinbase",
|
||||
version,
|
||||
indexer.vecs.transactions.height.read_only_boxed_clone(),
|
||||
indexer
|
||||
.vecs
|
||||
.transactions
|
||||
.first_txindex
|
||||
.first_tx_index
|
||||
.read_only_boxed_clone(),
|
||||
|index: TxIndex, _height, first_txindex| StoredBool::from(index == first_txindex),
|
||||
|index: TxIndex, _height, first_tx_index| StoredBool::from(index == first_tx_index),
|
||||
);
|
||||
|
||||
Ok(Self {
|
||||
@@ -34,7 +34,7 @@ impl Vecs {
|
||||
indexes,
|
||||
cached_starts,
|
||||
)?,
|
||||
is_coinbase: txindex_to_is_coinbase,
|
||||
is_coinbase: tx_index_to_is_coinbase,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,23 +19,23 @@ impl Vecs {
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
self.input_value.compute_sum_from_indexes(
|
||||
starting_indexes.txindex,
|
||||
&indexer.vecs.transactions.first_txinindex,
|
||||
&indexes.txindex.input_count,
|
||||
starting_indexes.tx_index,
|
||||
&indexer.vecs.transactions.first_txin_index,
|
||||
&indexes.tx_index.input_count,
|
||||
&txins.spent.value,
|
||||
exit,
|
||||
)?;
|
||||
|
||||
self.output_value.compute_sum_from_indexes(
|
||||
starting_indexes.txindex,
|
||||
&indexer.vecs.transactions.first_txoutindex,
|
||||
&indexes.txindex.output_count,
|
||||
starting_indexes.tx_index,
|
||||
&indexer.vecs.transactions.first_txout_index,
|
||||
&indexes.tx_index.output_count,
|
||||
&indexer.vecs.outputs.value,
|
||||
exit,
|
||||
)?;
|
||||
|
||||
self.fee.txindex.compute_transform2(
|
||||
starting_indexes.txindex,
|
||||
self.fee.tx_index.compute_transform2(
|
||||
starting_indexes.tx_index,
|
||||
&self.input_value,
|
||||
&self.output_value,
|
||||
|(i, input, output, ..)| {
|
||||
@@ -49,11 +49,11 @@ impl Vecs {
|
||||
exit,
|
||||
)?;
|
||||
|
||||
self.fee_rate.txindex.compute_transform2(
|
||||
starting_indexes.txindex,
|
||||
&self.fee.txindex,
|
||||
&size_vecs.vsize.txindex,
|
||||
|(txindex, fee, vsize, ..)| (txindex, FeeRate::from((fee, vsize))),
|
||||
self.fee_rate.tx_index.compute_transform2(
|
||||
starting_indexes.tx_index,
|
||||
&self.fee.tx_index,
|
||||
&size_vecs.vsize.tx_index,
|
||||
|(tx_index, fee, vsize, ..)| (tx_index, FeeRate::from((fee, vsize))),
|
||||
exit,
|
||||
)?;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ impl Vecs {
|
||||
version: Version,
|
||||
indexer: &Indexer,
|
||||
) -> Result<Self> {
|
||||
let txindex_to_vsize = LazyVecFrom2::init(
|
||||
let tx_index_to_vsize = LazyVecFrom2::init(
|
||||
"tx_vsize",
|
||||
version,
|
||||
indexer.vecs.transactions.base_size.read_only_boxed_clone(),
|
||||
@@ -23,9 +23,9 @@ impl Vecs {
|
||||
);
|
||||
|
||||
let vsize =
|
||||
LazyPerTxDistribution::forced_import(db, "tx_vsize", version, txindex_to_vsize)?;
|
||||
LazyPerTxDistribution::forced_import(db, "tx_vsize", version, tx_index_to_vsize)?;
|
||||
|
||||
let txindex_to_weight = LazyVecFrom2::init(
|
||||
let tx_index_to_weight = LazyVecFrom2::init(
|
||||
"tx_weight",
|
||||
version,
|
||||
indexer.vecs.transactions.base_size.read_only_boxed_clone(),
|
||||
@@ -36,7 +36,7 @@ impl Vecs {
|
||||
let weight = LazyPerTxDistributionTransformed::new::<VSizeToWeight>(
|
||||
"tx_weight",
|
||||
version,
|
||||
txindex_to_weight,
|
||||
tx_index_to_weight,
|
||||
&vsize.distribution,
|
||||
);
|
||||
|
||||
|
||||
@@ -14,20 +14,20 @@ impl Vecs {
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
let tx_vany = |tx_vany: &mut PerBlockCumulativeWithSums<StoredU64, StoredU64>,
|
||||
txversion: TxVersion| {
|
||||
let txversion_vec = &indexer.vecs.transactions.txversion;
|
||||
tx_version: TxVersion| {
|
||||
let tx_version_vec = &indexer.vecs.transactions.tx_version;
|
||||
// Cursor avoids per-transaction PcoVec page decompression.
|
||||
// Txindex values are sequential, so the cursor only advances forward.
|
||||
let mut cursor = txversion_vec.cursor();
|
||||
let mut cursor = tx_version_vec.cursor();
|
||||
tx_vany.compute(starting_indexes.height, exit, |vec| {
|
||||
vec.compute_filtered_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.transactions.first_txindex,
|
||||
&indexer.vecs.transactions.first_tx_index,
|
||||
&indexer.vecs.transactions.txid,
|
||||
|txindex| {
|
||||
let ti = txindex.to_usize();
|
||||
|tx_index| {
|
||||
let ti = tx_index.to_usize();
|
||||
cursor.advance(ti - cursor.position());
|
||||
cursor.next().unwrap() == txversion
|
||||
cursor.next().unwrap() == tx_version
|
||||
},
|
||||
exit,
|
||||
)?;
|
||||
|
||||
@@ -29,8 +29,8 @@ impl Vecs {
|
||||
|sats_vec| {
|
||||
Ok(sats_vec.compute_filtered_sum_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.transactions.first_txindex,
|
||||
&indexes.height.txindex_count,
|
||||
&indexer.vecs.transactions.first_tx_index,
|
||||
&indexes.height.tx_index_count,
|
||||
&fees_vecs.input_value,
|
||||
|sats| !sats.is_max(),
|
||||
exit,
|
||||
@@ -45,8 +45,8 @@ impl Vecs {
|
||||
|sats_vec| {
|
||||
Ok(sats_vec.compute_sum_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.transactions.first_txindex,
|
||||
&indexes.height.txindex_count,
|
||||
&indexer.vecs.transactions.first_tx_index,
|
||||
&indexes.height.tx_index_count,
|
||||
&fees_vecs.output_value,
|
||||
exit,
|
||||
)?)
|
||||
|
||||
Reference in New Issue
Block a user