Do not include self transfer in home events
This commit is contained in:
parent
790beaa670
commit
79057a0cd9
@ -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(
|
||||
|
||||
@ -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<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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user