Skip to content

Commit

Permalink
Amend
Browse files Browse the repository at this point in the history
  • Loading branch information
raphjaph committed Dec 20, 2024
1 parent 6ce7ba3 commit 249d908
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1575,22 +1575,20 @@ impl Index {
&self,
outpoints: &Vec<OutPoint>,
) -> Result<Option<Vec<InscriptionId>>> {
if !self.index_inscriptions {
return Ok(None);
}

let mut inscriptions = Vec::new();
let mut result = Vec::new();
for outpoint in outpoints {
inscriptions.extend(
self
.get_inscriptions_on_output_with_satpoints(*outpoint)?
.unwrap_or_default()
let Some(inscriptions) = self.get_inscriptions_on_output_with_satpoints(*outpoint)? else {
return Ok(None);
};

result.extend(
inscriptions
.iter()
.map(|(_satpoint, inscription_id)| *inscription_id),
);
}

Ok(Some(inscriptions))
Ok(Some(result))
}

pub fn get_transaction(&self, txid: Txid) -> Result<Option<Transaction>> {
Expand Down

0 comments on commit 249d908

Please sign in to comment.