From 7f63b7689efcb78a6efecc8056c5bff7a7b71b6a Mon Sep 17 00:00:00 2001 From: Mariusz Klochowicz Date: Thu, 14 Oct 2021 15:05:10 +1030 Subject: [PATCH] Display link to collaborative settlement transaction in the Cfd details --- daemon/src/to_sse_event.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/daemon/src/to_sse_event.rs b/daemon/src/to_sse_event.rs index 7ce4362..8ca8f80 100644 --- a/daemon/src/to_sse_event.rs +++ b/daemon/src/to_sse_event.rs @@ -360,11 +360,22 @@ fn to_tx_url_list(state: model::cfd::CfdState, network: Network) -> Vec { let tx_ub = TxUrlBuilder::new(network); match state { - PendingOpen { dlc, .. } | Open { dlc, .. } => { + PendingOpen { dlc, .. } => { vec![tx_ub.lock(&dlc)] } PendingCommit { dlc, .. } => vec![tx_ub.lock(&dlc), tx_ub.commit(&dlc)], OpenCommitted { dlc, .. } => vec![tx_ub.lock(&dlc), tx_ub.commit(&dlc)], + Open { + dlc, + collaborative_close, + .. + } => { + let mut tx_urls = vec![tx_ub.lock(&dlc)]; + if let Some(collaborative_close) = collaborative_close { + tx_urls.push(tx_ub.collaborative_close(collaborative_close.tx.txid())); + } + tx_urls + } PendingCet { dlc, attestation, .. } => vec![