indexer: speed

This commit is contained in:
nym21
2025-10-19 21:18:15 +02:00
parent 71078b5bdd
commit e9f6295014
27 changed files with 248 additions and 288 deletions

View File

@@ -58,7 +58,7 @@ impl ComputedValueVecsFromTxindex {
version + VERSION,
source_vec.map_or_else(|| sats.txindex.as_ref().unwrap().boxed_clone(), |s| s),
|txindex: TxIndex, iter| {
iter.next_at(txindex.unwrap_to_usize()).map(|(_, value)| {
iter.next_at(txindex.to_usize()).map(|(_, value)| {
let sats = value.into_owned();
Bitcoin::from(sats)
})
@@ -85,7 +85,7 @@ impl ComputedValueVecsFromTxindex {
txindex_to_btc_iter,
txindex_to_height_iter,
height_to_price_close_iter| {
let txindex = txindex.unwrap_to_usize();
let txindex = txindex.to_usize();
txindex_to_btc_iter.next_at(txindex).and_then(|(_, value)| {
let btc = value.into_owned();
txindex_to_height_iter
@@ -93,7 +93,7 @@ impl ComputedValueVecsFromTxindex {
.and_then(|(_, value)| {
let height = value.into_owned();
height_to_price_close_iter
.next_at(height.unwrap_to_usize())
.next_at(height.to_usize())
.map(|(_, close)| *close.into_owned() * btc)
})
})