mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-28 08:39:59 -07:00
global: snapshot
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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())
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user