From 79057a0cd9ea8010e91f9d7ea035a85c1b06bdb1 Mon Sep 17 00:00:00 2001 From: edouardparis Date: Thu, 19 Dec 2024 11:02:57 +0100 Subject: [PATCH] Do not include self transfer in home events --- liana-gui/src/app/view/home.rs | 6 +++++- liana-gui/src/daemon/model.rs | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/liana-gui/src/app/view/home.rs b/liana-gui/src/app/view/home.rs index 8300d14f..6b0234f9 100644 --- a/liana-gui/src/app/view/home.rs +++ b/liana-gui/src/app/view/home.rs @@ -148,7 +148,11 @@ pub fn home_view<'a>( .spacing(10) .push(h4_bold("Last payments")) .push(events.iter().fold(Column::new().spacing(10), |col, event| { - col.push(event_list_view(event)) + if event.kind != PaymentKind::SendToSelf { + col.push(event_list_view(event)) + } else { + col + } })) .push_maybe(if !is_last_page && !events.is_empty() { Some( diff --git a/liana-gui/src/daemon/model.rs b/liana-gui/src/daemon/model.rs index 4b0abbdf..1fc93f98 100644 --- a/liana-gui/src/daemon/model.rs +++ b/liana-gui/src/daemon/model.rs @@ -423,6 +423,7 @@ pub struct Payment { pub enum PaymentKind { Outgoing, Incoming, + SendToSelf, } impl Payment { @@ -488,7 +489,9 @@ pub fn payments_from_tx(history_tx: HistoryTransaction) -> Vec { outpoint, time, amount: output.value, - kind: if history_tx.is_external() { + kind: if history_tx.is_send_to_self() { + PaymentKind::SendToSelf + } else if history_tx.is_external() { PaymentKind::Incoming } else { PaymentKind::Outgoing