mirror of
https://github.com/alexgo-io/bitcoin-indexer.git
synced 2026-06-13 16:19:01 +08:00
fix: reuse existing computation for fix
This commit is contained in:
@@ -294,7 +294,7 @@ pub async fn scan_stacks_chainstate_via_csv_using_predicate(
|
||||
let mut err_count = 0;
|
||||
for (block_identifier, _parent_block_identifier, blob) in canonical_fork.drain(..) {
|
||||
if block_identifier.index <= start_block {
|
||||
continue
|
||||
continue;
|
||||
}
|
||||
|
||||
last_block_scanned = block_identifier;
|
||||
|
||||
@@ -308,8 +308,7 @@ pub fn get_entry_from_predicates_db(
|
||||
Some(payload) => payload,
|
||||
};
|
||||
|
||||
let status = serde_json::from_str(&encoded_status)
|
||||
.map_err(|e| format!("{}", e.to_string()))?;
|
||||
let status = serde_json::from_str(&encoded_status).map_err(|e| format!("{}", e.to_string()))?;
|
||||
|
||||
Ok(Some((spec, status)))
|
||||
}
|
||||
|
||||
@@ -1159,25 +1159,7 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
|
||||
}
|
||||
|
||||
let height = Height(ordinal_block_number.into());
|
||||
let mut ordinal_number = height.starting_sat().0 + ordinal_offset;
|
||||
|
||||
if input_index > 0 {
|
||||
let tx =
|
||||
match find_lazy_block_at_block_height(block_identifier.index as u32, 10, &blocks_db) {
|
||||
Some(block) => match block.find_and_serialize_transaction_with_txid(
|
||||
&transaction_identifier.get_8_hash_bytes(),
|
||||
) {
|
||||
Some(entry) => entry,
|
||||
None => unreachable!(),
|
||||
},
|
||||
None => {
|
||||
unimplemented!()
|
||||
}
|
||||
};
|
||||
for i in 0..input_index {
|
||||
ordinal_number += tx.inputs[i].txin_value;
|
||||
}
|
||||
}
|
||||
let ordinal_number = height.starting_sat().0 + ordinal_offset + inscription_offset;
|
||||
|
||||
Ok(TraversalResult {
|
||||
inscription_number,
|
||||
|
||||
Reference in New Issue
Block a user