Skip to content

failed swaps are not recognized by GUI #625

@jorian

Description

@jorian

Swaps that fail are not recognized by the GUI. This has been a change from mm1.0; in mm1.0 there wasn't a clear way to tell that a swap had failed.

In mm2.0 however, using the my_swap_status API call, there is a way to find out if something has failed.

As an example, I tried to swap 1 CHIPS for KMD. On the taker side (the HyperDEX app), the order stays in the Open Orders screen, with a matched label:

image

However, when I open one of the 2 failed swaps in the screenshot, I see this ugly error message:

image

The app should be able to recognize that the swap has failed, by issuing a my_swap_status call and look for events that are labeled [...]Failed, like the following example (this is the maker side of the same swap):

{
        "event": {
          "data": {
            "error": "maker_swap:449] utxo:842] utxo:546] utxo:546] rpc_clients:934] JsonRpcError { request: JsonRpcRequest { jsonrpc: \"2.0\", id: \"69275\", method: \"blockchain.scripthash.listunspent\", params: [String(\"2ae8a38b945cb64a96190d735fadca5ce9532b9e494b863aaeaedf6cf99b12c6\")] }, error: Transport(\"rpc_clients:770] rpc_clients:770] [\\\"rpc_clients:1412] common:1070] future timed out\\\"]\") }"
          },
          "type": "MakerPaymentTransactionFailed"
        },
        "timestamp": 1575016520768
      },

The type of this event ends with Failed.

So 2 things need fixing here:

  1. The label needs to show a swap has failed
  2. The user / app should remove such orders, as they clearly aren't Open Orders anymore. They should only show up in trade history.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmm2.0mm2.0 protocol change related

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions