fix: handle non-spending transaction

This commit is contained in:
Ludo Galabru
2023-05-04 10:42:24 -04:00
parent 9431684afe
commit cb01eb55fd

View File

@@ -1089,6 +1089,13 @@ pub fn retrieve_satoshi_point_using_local_storage(
local_block_cache.clear();
hops += 1;
if hops as u64 > block_identifier.index {
return Err(format!(
"Unable to process transaction {}, manual investigation required",
transaction_identifier.hash
));
}
let block = match local_block_cache.get(&ordinal_block_number) {
Some(block) => block,
None => match find_block_at_block_height(ordinal_block_number, 3, &blocks_db) {
@@ -1205,6 +1212,13 @@ pub fn retrieve_satoshi_point_using_local_storage(
break;
}
}
if sats_in == 0 {
return Err(format!(
"Transaction {} is originating from a non spending transaction",
transaction_identifier.hash
));
}
}
}
}