ExchangeUnion / xud

Exchange Union Daemon 🔁 ⚡️
https://exchangeunion.com
GNU Affero General Public License v3.0
115 stars 44 forks source link

Remove SwapCompleted packets & status #1483

Closed sangaman closed 4 years ago

sangaman commented 4 years ago

This issue tracks removing the redundant SwapCompleted and the corresponding swap status. This packet has long been a formality - it is sent only after the swap is actually settled, and recently it has caused some headaches and complexity for development purposes. Furthermore setting the complete status crates an unnecessary depency on a peer cooperating and sending us this packet.

Instead, each node should consider a swap to be completed once it has received the funds from its side of the swap. At that point, all obligations related to the swap should be considered complete for that node. We can consider the existing PaymentReceived swap status to mean that a swap is complete.

Note that this introduces some potentially breaking changes on the p2p communication layer, as nodes still relying on SwapCompleted packets may experience issues.

kilrau commented 4 years ago

Affects BOLD #4, let's start with a PR there.

kilrau commented 4 years ago

Changes on the BOLD side were merged: https://github.com/opendexnetwork/opendex/pulls?q=is%3Apr+is%3Aclosed and since this is needed for connext to avoid workarounds afaik, let's do this!