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, msg: GetAnnouncement,
_ctx: &mut xtra::Context<Self>, _ctx: &mut xtra::Context<Self>,
) -> Option<Announcement> { ) -> Option<Announcement> {
self.announcements let announcement =
.get_key_value(&msg.0) self.announcements
.map(|(id, (time, nonce_pks))| Announcement { .get_key_value(&msg.0)
id: *id, .map(|(id, (time, nonce_pks))| Announcement {
expected_outcome_time: *time, id: *id,
nonce_pks: nonce_pks.clone(), expected_outcome_time: *time,
}) nonce_pks: nonce_pks.clone(),
});
if announcement.is_none() {
self.pending_announcements.insert(msg.0);
}
announcement
} }
} }

Loading…
Cancel
Save