atomicDEX-API
atomicDEX-API copied to clipboard
Swap fails immediately if transaction cannot be sent
When the taker is sending a transaction, e.g. the maker payment spend transaction:
https://github.com/KomodoPlatform/komodo-defi-framework/blob/3cbb54def955f3c4dc9ee7a3d9f631ed45cb5bd2/mm2src/mm2_main/src/lp_swap/taker_swap.rs#L1737-L1746
or the taker payment refund transaction:
https://github.com/KomodoPlatform/komodo-defi-framework/blob/3cbb54def955f3c4dc9ee7a3d9f631ed45cb5bd2/mm2src/mm2_main/src/lp_swap/taker_swap.rs#L1831-L1839
swap fails immediately if the transactions cannot be sent for any reason, e.g. a connection problem. The same problem also exists when the maker is sending transactions. These should be repeated for certain periods before failing the swaps. This is a problem that should be fixed in general, but also can cause problems (while being an edge case) if a taker fails at these points, a watcher completes the swap meanwhile and the taker is restarted, in which case the swap will always be saved as a failure. An example of these scenarios is explained in detail in #1908.