From 249d9089b4d9d13ca768b0f2e0196e0d18f47653 Mon Sep 17 00:00:00 2001 From: raphjaph Date: Thu, 19 Dec 2024 20:12:28 -0500 Subject: [PATCH] Amend --- src/index.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/index.rs b/src/index.rs index 467b82f7f3..b5e035b668 100644 --- a/src/index.rs +++ b/src/index.rs @@ -1575,22 +1575,20 @@ impl Index { &self, outpoints: &Vec, ) -> Result>> { - 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> {