Browse Source
Oracle actor initial state update
Block until we are sure that the update was done, because otherwise we might have weird side effects in the UI because there is a dependency on the announcements being available when creating offers.
feature/integration-tests
Daniel Karzel
3 years ago
No known key found for this signature in database
GPG Key ID: 30C3FC2E438ADB6E
2 changed files with
8 additions and
2 deletions
daemon/src/maker.rs
daemon/src/taker.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 ) ) = > {
@ -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 ) )
} ,
) )