From 79de722cf4ad39d8196ea84bdebdbe796bbf9b7a Mon Sep 17 00:00:00 2001 From: Philipp Hoenisch Date: Fri, 8 Oct 2021 09:35:49 +1100 Subject: [PATCH 1/4] Bug fix: chose correct identity --- daemon/src/setup_contract.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/src/setup_contract.rs b/daemon/src/setup_contract.rs index e20c063..e3e43d7 100644 --- a/daemon/src/setup_contract.rs +++ b/daemon/src/setup_contract.rs @@ -314,13 +314,13 @@ pub async fn roll_over( let own_cfd_txs = renew_cfd_transactions( lock_tx.clone(), ( - pk, + maker_identity, maker_lock_amount, dlc.maker_address.clone(), maker_punish_params, ), ( - dlc.identity_counterparty, + taker_identity, taker_lock_amount, dlc.taker_address.clone(), taker_punish_params, From 1eb332d6fd94a6abf17cf06e43e8f273eeba2853 Mon Sep 17 00:00:00 2001 From: Philipp Hoenisch Date: Fri, 8 Oct 2021 09:48:55 +1100 Subject: [PATCH 2/4] Bug fix: overflow Checking for confirmations 0 results in an overflow. --- daemon/src/monitor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/src/monitor.rs b/daemon/src/monitor.rs index f6e36ae..c847b99 100644 --- a/daemon/src/monitor.rs +++ b/daemon/src/monitor.rs @@ -244,7 +244,7 @@ where .entry((revoked_commit_tx.0, revoked_commit_tx.1.clone())) .or_default() .push(( - ScriptStatus::with_confirmations(0), + ScriptStatus::InMempool, Event::RevokedTransactionFound(order_id), )); } From d8bf7410d41bc69980aa171622206e72e8309948 Mon Sep 17 00:00:00 2001 From: Philipp Hoenisch Date: Fri, 8 Oct 2021 09:55:15 +1100 Subject: [PATCH 3/4] Bug fix: allow state transition from open to open When renewing we don't have an additional state, instead we transition from open to open --- daemon/src/model/cfd.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/daemon/src/model/cfd.rs b/daemon/src/model/cfd.rs index 66ba9da..f0ca9bc 100644 --- a/daemon/src/model/cfd.rs +++ b/daemon/src/model/cfd.rs @@ -526,6 +526,17 @@ impl Cfd { dlc, attestation: None, } + } else if let Open { + dlc, attestation, .. + } = self.state.clone() + { + CfdState::Open { + common: CfdStateCommon { + transition_timestamp: SystemTime::now(), + }, + dlc, + attestation, + } } else { bail!( "Cannot transition to Open because of unexpected state {}", From 9de0376daa008e5f612a5686684c66365cf677d5 Mon Sep 17 00:00:00 2001 From: Philipp Hoenisch Date: Fri, 8 Oct 2021 10:04:43 +1100 Subject: [PATCH 4/4] Bug fix: Remove pending roll over requests Otherwise the UI won't update --- daemon/src/taker_cfd.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon/src/taker_cfd.rs b/daemon/src/taker_cfd.rs index fe40288..c6a5231 100644 --- a/daemon/src/taker_cfd.rs +++ b/daemon/src/taker_cfd.rs @@ -407,6 +407,8 @@ impl Actor { .await }); + self.remove_pending_proposal(&order_id) + .context("Could not remove accepted roll over")?; Ok(()) }