mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-28 16:49:58 -07:00
global: snapshot
This commit is contained in:
@@ -11,7 +11,6 @@ pub use brk_parser::rpc;
|
||||
|
||||
mod storage;
|
||||
|
||||
use brk_core::Date;
|
||||
use log::info;
|
||||
use storage::{Stores, Vecs};
|
||||
|
||||
@@ -53,101 +52,7 @@ impl Computer {
|
||||
) -> color_eyre::Result<()> {
|
||||
info!("Computing...");
|
||||
|
||||
let height_count = indexer.vecs().height_to_size.len();
|
||||
let txindexes_count = indexer.vecs().txindex_to_txid.len();
|
||||
let txinindexes_count = indexer.vecs().txinindex_to_txoutindex.len();
|
||||
let txoutindexes_count = indexer.vecs().txoutindex_to_addressindex.len();
|
||||
|
||||
// self.vecs.txindex_to_last_txinindex.compute_last_index_from_first(
|
||||
// starting_indexes.txindex,
|
||||
// &mut indexer.vecs().txindex_to_first_txinindex,
|
||||
// txinindexes_count,
|
||||
// exit,
|
||||
// )?;
|
||||
|
||||
// self.vecs.txindex_to_inputs_count.compute_count_from_indexes(
|
||||
// starting_indexes.txindex,
|
||||
// &mut indexer.vecs().txindex_to_first_txinindex,
|
||||
// &mut self.vecs.txindex_to_last_txinindex,
|
||||
// exit,
|
||||
// )?;
|
||||
|
||||
// self.vecs.txindex_to_last_txoutindex.compute_last_index_from_first(
|
||||
// starting_indexes.txindex,
|
||||
// &mut indexer.vecs().txindex_to_first_txoutindex,
|
||||
// txoutindexes_count,
|
||||
// exit,
|
||||
// )?;
|
||||
|
||||
// self.vecs.txindex_to_outputs_count.compute_count_from_indexes(
|
||||
// starting_indexes.txindex,
|
||||
// &mut indexer.vecs().txindex_to_first_txoutindex,
|
||||
// &mut self.vecs.txindex_to_last_txoutindex,
|
||||
// exit,
|
||||
// )?;
|
||||
|
||||
self.mut_vecs().height_to_height.compute_transform(
|
||||
starting_indexes.height,
|
||||
&mut indexer.mut_vecs().height_to_timestamp,
|
||||
|_, height| height,
|
||||
exit,
|
||||
)?;
|
||||
|
||||
self.mut_vecs().height_to_date.compute_transform(
|
||||
starting_indexes.height,
|
||||
&mut indexer.mut_vecs().height_to_timestamp,
|
||||
|timestamp, _| Date::from(*timestamp),
|
||||
exit,
|
||||
)?;
|
||||
|
||||
// self.vecs.height_to_last_txindex.compute_last_index_from_first(
|
||||
// starting_indexes.height,
|
||||
// &mut indexer.vecs().height_to_first_txindex,
|
||||
// height_count,
|
||||
// exit,
|
||||
// )?;
|
||||
|
||||
// self.vecs.txindex_to_height.compute_inverse_less_to_more(
|
||||
// starting_indexes.height,
|
||||
// &mut indexer.vecs().height_to_first_txindex,
|
||||
// &mut self.vecs.height_to_last_txindex,
|
||||
// exit,
|
||||
// )?;
|
||||
|
||||
// self.vecs.txindex_to_is_coinbase.compute_is_first_ordered(
|
||||
// starting_indexes.txindex,
|
||||
// &mut self.vecs.txindex_to_height,
|
||||
// &mut indexer.vecs().height_to_first_txindex,
|
||||
// exit,
|
||||
// )?;
|
||||
|
||||
// self.vecs.txindex_to_fee.compute_transform(
|
||||
// &mut self.vecs.txindex_to_height,
|
||||
// &mut indexer.vecs().height_to_first_txindex,
|
||||
// )?;
|
||||
|
||||
let date_count = self.vecs().height_to_date.len();
|
||||
|
||||
// self.vecs.height_to_dateindex.compute(...)
|
||||
|
||||
// self.vecs
|
||||
// .dateindex_to_first_height
|
||||
// .compute_inverse_more_to_less(&mut self.vecs.height_to_dateindex, exit)?;
|
||||
|
||||
// ---
|
||||
// Date to X
|
||||
// ---
|
||||
// ...
|
||||
|
||||
// ---
|
||||
// Month to X
|
||||
// ---
|
||||
// ...
|
||||
|
||||
// ---
|
||||
// Year to X
|
||||
// ---
|
||||
// ...
|
||||
self.mut_vecs().compute(indexer, starting_indexes, exit)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user