mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 14:49:58 -07:00
global: speed improvement part2
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
use brk_error::Result;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_types::{StoredBool, TxIndex, Version};
|
||||
use vecdb::{Database, LazyVecFrom2, ReadableCloneableVec};
|
||||
use brk_types::Version;
|
||||
use vecdb::Database;
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
@@ -13,25 +12,11 @@ impl Vecs {
|
||||
pub(crate) fn forced_import(
|
||||
db: &Database,
|
||||
version: Version,
|
||||
indexer: &Indexer,
|
||||
indexes: &indexes::Vecs,
|
||||
cached_starts: &CachedWindowStarts,
|
||||
) -> Result<Self> {
|
||||
let tx_index_to_is_coinbase = LazyVecFrom2::init(
|
||||
"is_coinbase",
|
||||
version,
|
||||
indexer.vecs.transactions.height.read_only_boxed_clone(),
|
||||
indexer
|
||||
.vecs
|
||||
.transactions
|
||||
.first_tx_index
|
||||
.read_only_boxed_clone(),
|
||||
|index: TxIndex, _height, first_tx_index| StoredBool::from(index == first_tx_index),
|
||||
);
|
||||
|
||||
Ok(Self {
|
||||
total: PerBlockFull::forced_import(db, "tx_count", version, indexes, cached_starts)?,
|
||||
is_coinbase: tx_index_to_is_coinbase,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user