Browse Source

Fetch announcement in case it is not present but requested

This will make sure that if a user retries an operation, the
announcement is there.
testing
Thomas Eizinger 3 years ago
parent
commit
6d033264e8
No known key found for this signature in database GPG Key ID: 651AC83A6C6C8B96
  1. 21
      daemon/src/oracle.rs

21
daemon/src/oracle.rs

@ -224,13 +224,20 @@ impl xtra::Handler<GetAnnouncement> for Actor {
msg: GetAnnouncement,
_ctx: &mut xtra::Context<Self>,
) -> Option<Announcement> {
self.announcements
.get_key_value(&msg.0)
.map(|(id, (time, nonce_pks))| Announcement {
id: *id,
expected_outcome_time: *time,
nonce_pks: nonce_pks.clone(),
})
let announcement =
self.announcements
.get_key_value(&msg.0)
.map(|(id, (time, nonce_pks))| Announcement {
id: *id,
expected_outcome_time: *time,
nonce_pks: nonce_pks.clone(),
});
if announcement.is_none() {
self.pending_announcements.insert(msg.0);
}
announcement
}
}

Loading…
Cancel
Save