Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: treat change outputs as send-to-self payments #1507

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion liana-gui/src/daemon/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ pub struct Payment {
pub enum PaymentKind {
Outgoing,
Incoming,
/// A payment to self, which could be either from a self-transfer
/// or a change output from an outgoing transaction.
SendToSelf,
}

Expand Down Expand Up @@ -489,7 +491,9 @@ pub fn payments_from_tx(history_tx: HistoryTransaction) -> Vec<Payment> {
outpoint,
time,
amount: output.value,
kind: if history_tx.is_send_to_self() {
kind: if history_tx.is_send_to_self()
|| history_tx.change_indexes.contains(&output_index)
{
PaymentKind::SendToSelf
} else if history_tx.is_external() {
PaymentKind::Incoming
Expand Down
Loading