Skip to content

Commit

Permalink
Merge pull request #551 from MutinyWallet/activity-tweaks
Browse files Browse the repository at this point in the history
sort activity newest first and don't include unpaid invoices
  • Loading branch information
futurepaul authored Jun 1, 2023
2 parents 1b52953 + 41ac36f commit 0346629
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mutiny-core/src/nodemanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -926,13 +926,18 @@ impl<S: MutinyStorage> NodeManager<S> {
let onchain = self.list_onchain()?;
let mut activity = Vec::with_capacity(lightning.len() + onchain.len());
for ln in lightning {
activity.push(ActivityItem::Lightning(Box::new(ln)));
// Only show paid invoices
if ln.paid {
activity.push(ActivityItem::Lightning(Box::new(ln)));
}
}
for on in onchain {
activity.push(ActivityItem::OnChain(on));
}

activity.sort();
// Newest first
activity.sort_by(|a, b| b.cmp(a));

Ok(activity)
}

Expand Down

0 comments on commit 0346629

Please sign in to comment.