mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-30 04:08:11 -07:00
global: snapshot
This commit is contained in:
@@ -207,6 +207,6 @@ where
|
||||
} else if h + 1_u32 == starting_height {
|
||||
Some(I::from(index_to_else.len()))
|
||||
} else {
|
||||
height_to_index.collect_one(starting_height.to_usize())
|
||||
height_to_index.collect_one(starting_height)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ impl Stores {
|
||||
vecs: &mut Vecs,
|
||||
starting_indexes: &Indexes,
|
||||
) -> Result<()> {
|
||||
vecs.blocks.blockhash.for_each_range(
|
||||
vecs.blocks.blockhash.for_each_range_at(
|
||||
starting_indexes.height.to_usize(),
|
||||
vecs.blocks.blockhash.len(),
|
||||
|blockhash| {
|
||||
@@ -272,7 +272,7 @@ impl Stores {
|
||||
let start = starting_indexes.txindex.to_usize();
|
||||
let end = vecs.transactions.txid.len();
|
||||
let mut current_index = start;
|
||||
vecs.transactions.txid.for_each_range(start, end, |txid| {
|
||||
vecs.transactions.txid.for_each_range_at(start, end, |txid| {
|
||||
let txindex = TxIndex::from(current_index);
|
||||
let txidprefix = TxidPrefix::from(&txid);
|
||||
|
||||
@@ -303,7 +303,7 @@ impl Stores {
|
||||
let rollback_end = vecs.outputs.outputtype.len();
|
||||
|
||||
let txindexes: Vec<TxIndex> =
|
||||
vecs.outputs.txindex.collect_range(rollback_start, rollback_end);
|
||||
vecs.outputs.txindex.collect_range_at(rollback_start, rollback_end);
|
||||
|
||||
for (i, txoutindex) in (rollback_start..rollback_end).enumerate() {
|
||||
let outputtype = txoutindex_to_outputtype_reader.get(txoutindex);
|
||||
@@ -332,8 +332,8 @@ impl Stores {
|
||||
|
||||
let start = starting_indexes.txinindex.to_usize();
|
||||
let end = vecs.inputs.outpoint.len();
|
||||
let outpoints: Vec<OutPoint> = vecs.inputs.outpoint.collect_range(start, end);
|
||||
let spending_txindexes: Vec<TxIndex> = vecs.inputs.txindex.collect_range(start, end);
|
||||
let outpoints: Vec<OutPoint> = vecs.inputs.outpoint.collect_range_at(start, end);
|
||||
let spending_txindexes: Vec<TxIndex> = vecs.inputs.txindex.collect_range_at(start, end);
|
||||
|
||||
let outputs_to_unspend: Vec<_> = outpoints
|
||||
.into_iter()
|
||||
|
||||
@@ -250,8 +250,7 @@ impl AddressesVecs {
|
||||
) -> Result<Box<dyn Iterator<Item = AddressHash> + '_>> {
|
||||
macro_rules! make_iter {
|
||||
($height_vec:expr, $bytes_vec:expr) => {{
|
||||
let h = height.to_usize();
|
||||
match $height_vec.collect_one(h) {
|
||||
match $height_vec.collect_one(height) {
|
||||
Some(mut index) => {
|
||||
let reader = $bytes_vec.reader();
|
||||
Ok(Box::new(std::iter::from_fn(move || {
|
||||
|
||||
Reference in New Issue
Block a user