Skip to content

Commit

Permalink
Do not include self transfer in home events
Browse files Browse the repository at this point in the history
  • Loading branch information
edouardparis committed Dec 19, 2024
1 parent 790beaa commit 79057a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion liana-gui/src/app/view/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 4 additions & 1 deletion liana-gui/src/daemon/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ pub struct Payment {
pub enum PaymentKind {
Outgoing,
Incoming,
SendToSelf,
}

impl Payment {
Expand Down Expand Up @@ -488,7 +489,9 @@ pub fn payments_from_tx(history_tx: HistoryTransaction) -> Vec<Payment> {
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
Expand Down

0 comments on commit 79057a0

Please sign in to comment.