Skip to content

Commit

Permalink
Swapd: Revert changes to tx removal to invalidate prior states
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCharlatan committed Jun 28, 2022
1 parent ce66697 commit 307d529
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/swapd/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1366,9 +1366,9 @@ impl Runtime {
self.send_ctl(endpoints, ServiceId::Wallet, swap_success_req.clone())?;
self.send_ctl(endpoints, ServiceId::Farcasterd, swap_success_req)?;
// remove txs from outdated states
self.txs.remove(&TxLabel::Lock);
self.txs.remove(&TxLabel::Cancel);
self.txs.remove(&TxLabel::Refund);
self.txs.remove(&TxLabel::Buy);
self.txs.remove(&TxLabel::Punish);
}
}
Expand Down Expand Up @@ -1712,8 +1712,6 @@ impl Runtime {
swap_success_req.clone(),
)?;
self.send_ctl(endpoints, ServiceId::Farcasterd, swap_success_req)?;
// remove txs from outdated states
self.txs.remove(&TxLabel::Lock);
self.txs.remove(&TxLabel::Buy);
self.txs.remove(&TxLabel::Cancel);
self.txs.remove(&TxLabel::Punish);
Expand Down Expand Up @@ -1816,7 +1814,6 @@ impl Runtime {
)?;
self.send_ctl(endpoints, ServiceId::Farcasterd, swap_success_req)?;
// remove txs from outdated states
self.txs.remove(&TxLabel::Lock);
self.txs.remove(&TxLabel::Cancel);
self.txs.remove(&TxLabel::Refund);
self.txs.remove(&TxLabel::Buy);
Expand Down Expand Up @@ -1859,8 +1856,7 @@ impl Runtime {
swap_success_req.clone(),
)?;
self.send_ctl(endpoints, ServiceId::Farcasterd, swap_success_req)?;
// remove txs from outdated states
self.txs.remove(&TxLabel::Lock);
// remove txs to invalidate outdated states
self.txs.remove(&TxLabel::Cancel);
self.txs.remove(&TxLabel::Refund);
self.txs.remove(&TxLabel::Buy);
Expand Down

0 comments on commit 307d529

Please sign in to comment.