global: snapshot

This commit is contained in:
nym21
2025-11-09 11:25:13 +01:00
parent e77fe0253e
commit dc2e847f58
30 changed files with 521 additions and 497 deletions

View File

@@ -81,7 +81,7 @@ impl Vecs {
.enumerate()
.try_for_each(|(i, v)| -> Result<()> {
self.height_to_price_ohlc_in_cents.forced_push_at(
i.into(),
i,
self.fetcher
.get_height(
i.into(),

View File

@@ -57,10 +57,7 @@ impl ComputedValueVecsFromTxindex {
&name_btc,
version + VERSION,
source_vec.map_or_else(|| sats.txindex.as_ref().unwrap().boxed_clone(), |s| s),
|txindex: TxIndex, iter| {
iter.get_at(txindex.to_usize())
.map(|sats| Bitcoin::from(sats))
},
|txindex: TxIndex, iter| iter.get_at(txindex.to_usize()).map(Bitcoin::from),
);
let bitcoin = ComputedVecsFromTxindex::forced_import(

View File

@@ -163,7 +163,7 @@ impl Vecs {
let start = usize::from(start);
let end = txindex_to_first_txinindex_iter
.get_at(txindex + 1)
.map(|v| usize::from(v))
.map(usize::from)
.unwrap_or_else(|| txinindex_to_txoutindex_iter.len());
StoredU64::from((start..end).count())
})
@@ -183,7 +183,7 @@ impl Vecs {
let start = usize::from(start);
let end = txindex_to_first_txoutindex_iter
.get_at(txindex + 1)
.map(|v| usize::from(v))
.map(usize::from)
.unwrap_or_else(|| txoutindex_to_value_iter.len());
StoredU64::from((start..end).count())
})