fix: override unpaginated pending events and txs

pending events and txs are passed unpaginated and
in full list through PendingTransactions and PendingPayments.
It is useless and armful to append to them to an existing
list of pending events as a new rbf replacement event should
override the previous one and only one of them must be displayed.
This commit is contained in:
edouardparis 2024-03-06 10:36:41 +01:00
parent 2995df870f
commit 18e040e51f
2 changed files with 2 additions and 10 deletions

View File

@ -186,11 +186,7 @@ impl State for Home {
Err(e) => self.warning = Some(e),
Ok(events) => {
self.warning = None;
for event in events {
if !self.pending_events.iter().any(|other| other.tx == event.tx) {
self.pending_events.push(event);
}
}
self.pending_events = events;
}
},
Message::View(view::Message::Label(_, _)) | Message::LabelsUpdated(_) => {

View File

@ -105,11 +105,7 @@ impl State for TransactionsPanel {
Err(e) => self.warning = Some(e),
Ok(txs) => {
self.warning = None;
for tx in txs {
if !self.pending_txs.iter().any(|other| other.tx == tx.tx) {
self.pending_txs.push(tx);
}
}
self.pending_txs = txs;
}
},
Message::RbfModal(tx, is_cancel, res) => match res {