From a328d43b743f6c61ad196544378849788748f534 Mon Sep 17 00:00:00 2001 From: Daniel Karzel Date: Mon, 18 Oct 2021 19:26:08 +1100 Subject: [PATCH 1/2] Remove pending roll over proposal upon rejection --- daemon/src/taker_cfd.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/daemon/src/taker_cfd.rs b/daemon/src/taker_cfd.rs index b66ba54..48fb763 100644 --- a/daemon/src/taker_cfd.rs +++ b/daemon/src/taker_cfd.rs @@ -248,11 +248,10 @@ impl Actor { } async fn handle_roll_over_rejected(&mut self, order_id: OrderId) -> Result<()> { - tracing::debug!(%order_id, "Roll over request rejected"); - // TODO: tell UI that roll over was rejected + tracing::info!(%order_id, "Roll over proposal got rejected"); - // this is not too bad as we are still monitoring for the CFD to expiry - // the taker can just try to ask again :) + self.remove_pending_proposal(&order_id) + .context("rejected settlement")?; Ok(()) } From f5db38a7242f5189bcf96e1898eeb69e7e9a6064 Mon Sep 17 00:00:00 2001 From: Daniel Karzel Date: Mon, 18 Oct 2021 19:41:13 +1100 Subject: [PATCH 2/2] Remove Todos in favour of tickets https://github.com/comit-network/hermes/issues/369 https://github.com/comit-network/hermes/issues/368 --- daemon/src/maker_cfd.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/daemon/src/maker_cfd.rs b/daemon/src/maker_cfd.rs index 01c32a6..39fddea 100644 --- a/daemon/src/maker_cfd.rs +++ b/daemon/src/maker_cfd.rs @@ -73,9 +73,6 @@ pub struct Actor { oracle_actor: Address, // Maker needs to also store TakerId to be able to send a reply back current_pending_proposals: HashMap, - // TODO: Persist instead of using an in-memory hashmap for resiliency? - // (not a huge deal, as in the worst case taker will fall back to - // noncollaborative settlement) current_agreed_proposals: HashMap, } @@ -746,8 +743,6 @@ where let dlc = cfd.open_dlc().context("CFD was in wrong state")?; - // TODO: do we want to store in the db that we rolled over? - let oracle_event_id = oracle::next_announcement_after(time::OffsetDateTime::now_utc() + Order::TERM)?; let announcement = self