Skip to content

core: need a refund path that doesn't rely on dex or wallet connections #952

@buck54321

Description

@buck54321

This issue deals with the ability to properly refund a swap-gone-wrong. There are two parts to this issue.

  1. bug: We don't load orders from the DB until we have already established a connection with the order's DEX. What happens when a DEX goes offline suddenly, causing swaps to fail, and doesn't come back? If a client is restarted before refund, they won't be able to refund until the DEX comes back online, potentially leaving the client's failed swap un-refunded beyond the lock time. This is a bug and a security hole that needs a solution.
  2. Even if the DEX is connected, if the wallet is not unlocked, we can't refund. But if we generated the refund at the same time as the swap output, there would be no reason to have an unlocked wallet to refund. We'd just be broadcasting. In theory, we don't even need a wallet connection to refund, as we could devise a path to broadcast the refund to e.g. dcrdata without a wallet backend at all. But having a refund path on a locked wallet is a start, as there would be a conceivable system configuration in which a refund could happen without user input in the case of an unexpected restart.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions