diff --git a/daemon/src/maker.rs b/daemon/src/maker.rs index 7611b8d..df837e3 100644 --- a/daemon/src/maker.rs +++ b/daemon/src/maker.rs @@ -227,7 +227,7 @@ async fn main() -> Result<()> { update_cfd_feed_sender, maker_inc_connections_address.clone(), monitor_actor_address.clone(), - oracle_actor_address, + oracle_actor_address.clone(), ) .create(None) .spawn_global(); @@ -265,6 +265,9 @@ async fn main() -> Result<()> { cfds, ))); + // use `.send` here to ensure we only continue once the update was processed + oracle_actor_address.send(oracle::Sync).await.unwrap(); + let listener_stream = futures::stream::poll_fn(move |ctx| { let message = match futures::ready!(listener.poll_accept(ctx)) { Ok((stream, address)) => { diff --git a/daemon/src/taker.rs b/daemon/src/taker.rs index f17fa25..0e7358f 100644 --- a/daemon/src/taker.rs +++ b/daemon/src/taker.rs @@ -227,7 +227,7 @@ async fn main() -> Result<()> { update_cfd_feed_sender, send_to_maker, monitor_actor_address.clone(), - oracle_actor_address, + oracle_actor_address.clone(), ) .create(None) .spawn_global(); @@ -264,6 +264,9 @@ async fn main() -> Result<()> { cfds, ))); + // use `.send` here to ensure we only continue once the update was processed + oracle_actor_address.send(oracle::Sync).await.unwrap(); + Ok(rocket.manage(cfd_actor_inbox).manage(cfd_feed_receiver)) }, ))