From d2d4c216db5174dba3cf9c4f294b37895e4bd5b9 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Tue, 12 Oct 2021 10:38:58 +1100 Subject: [PATCH] Don't fail attestation sync just because it is not attested yet --- daemon/src/oracle.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/daemon/src/oracle.rs b/daemon/src/oracle.rs index afe09e9..5399cef 100644 --- a/daemon/src/oracle.rs +++ b/daemon/src/oracle.rs @@ -165,10 +165,17 @@ where } }; - let attestation = res + let attestation = match res .json::() .await - .with_context(|| format!("Failed to decode body for event {}", event_id))?; + .with_context(|| format!("Failed to decode body for event {}", event_id)) + { + Ok(attestation) => attestation, + Err(e) => { + tracing::debug!("{:#}", e); + continue; + } + }; self.cfd_actor_address .clone() @@ -349,7 +356,7 @@ mod olivia_api { let data = serde_json::from_str::(&response.announcement.oracle_event.data)?; - let attestation = response.attestation.context("Missing attestation")?; + let attestation = response.attestation.context("attestation missing")?; Ok(Self { id: OracleEventId(data.id),