mirror of
https://github.com/alexgo-io/bitcoin-indexer.git
synced 2026-06-15 00:49:30 +08:00
feat: keep 1st tx in cache
This commit is contained in:
@@ -966,10 +966,13 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
|
||||
return Err(format!("block #{ordinal_block_number} not in database"));
|
||||
}
|
||||
Some(block) => match block.find_and_serialize_transaction_with_txid(&txid) {
|
||||
Some(tx) => (
|
||||
tx.get_sat_ranges(),
|
||||
tx.get_cumulated_sats_in_until_input_index(input_index),
|
||||
),
|
||||
Some(tx) => {
|
||||
let sats_ranges = tx.get_sat_ranges();
|
||||
let inscription_offset_cross_outputs =
|
||||
tx.get_cumulated_sats_in_until_input_index(input_index);
|
||||
traversals_cache.insert((ordinal_block_number, txid.clone()), tx);
|
||||
(sats_ranges, inscription_offset_cross_outputs)
|
||||
}
|
||||
None => return Err(format!("block #{ordinal_block_number} not in database")),
|
||||
},
|
||||
},
|
||||
|
||||
@@ -446,7 +446,7 @@ pub fn standardize_bitcoin_block(
|
||||
},
|
||||
timestamp: block.time as u32,
|
||||
metadata: BitcoinBlockMetadata {
|
||||
network: network.clone()
|
||||
network: network.clone(),
|
||||
},
|
||||
transactions,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user