Browse Source

Monitor oracle attestation after completed setup

Does not make sense to start this earlier and the code is only logical right after triggering the blockchain monitoring.
refactor/no-log-handler
Daniel Karzel 3 years ago
parent
commit
95d8910013
No known key found for this signature in database GPG Key ID: 30C3FC2E438ADB6E
  1. 14
      daemon/src/maker_cfd.rs
  2. 14
      daemon/src/taker_cfd.rs

14
daemon/src/maker_cfd.rs

@ -442,8 +442,6 @@ impl Actor {
tracing::info!("Lock transaction published with txid {}", txid);
// TODO: It's a bit suspicious to load this just to get the
// refund timelock
let cfd = load_cfd_by_order_id(order_id, &mut conn).await?;
self.monitor_actor
@ -453,6 +451,12 @@ impl Actor {
})
.await?;
self.oracle_actor
.do_send_async(oracle::MonitorAttestation {
event_id: cfd.order.oracle_event_id,
})
.await?;
Ok(())
}
@ -602,12 +606,6 @@ impl Actor {
.await?
.with_context(|| format!("Announcement {} not found", cfd.order.oracle_event_id))?;
self.oracle_actor
.do_send_async(oracle::MonitorAttestation {
event_id: offer_announcement.id,
})
.await?;
let contract_future = setup_contract::new(
self.takers.clone().into_sink().with(move |msg| {
future::ok(maker_inc_connections::TakerMessage {

14
daemon/src/taker_cfd.rs

@ -407,12 +407,6 @@ impl Actor {
.await?
.with_context(|| format!("Announcement {} not found", oracle_event_id))?;
self.oracle_actor
.do_send_async(oracle::MonitorAttestation {
event_id: announcement.id,
})
.await?;
let contract_future = setup_contract::roll_over(
self.send_to_maker
.clone()
@ -522,8 +516,6 @@ impl Actor {
tracing::info!("Lock transaction published with txid {}", txid);
// TODO: It's a bit suspicious to load this just to get the
// refund timelock
let cfd = load_cfd_by_order_id(order_id, &mut conn).await?;
self.monitor_actor
@ -533,6 +525,12 @@ impl Actor {
})
.await?;
self.oracle_actor
.do_send_async(oracle::MonitorAttestation {
event_id: cfd.order.oracle_event_id,
})
.await?;
Ok(())
}

Loading…
Cancel
Save