Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(legacy-refunds): support going the spending path on refund #2280

Open
wants to merge 19 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions mm2src/mm2_main/src/lp_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,22 @@ pub struct RecoveredSwap {
transaction: TransactionEnum,
}

#[derive(Display, Debug, PartialEq)]
pub enum RecoverSwapError {
// We might not find the original payment tx on chain (e.g. re-orged). This doesn't mean though that nobody has it.
// TODO: These coins should be spent ASAP to avoid them getting locked (or stolen).
mariocynicys marked this conversation as resolved.
Show resolved Hide resolved
#[display(fmt = "The payment tx is not on-chain. Nothing to recover.")]
PaymentTxNotFound,
#[display(fmt = "An unknown error occurred. Retrying might fix it: {}", _0)]
Temporary(String),
#[display(fmt = "The swap is not recoverable: {}", _0)]
Irrecoverable(String),
#[display(fmt = "Wait {}s and try to recover again.", _0)]
WaitAndRetry(u64),
#[display(fmt = "The funds will be automatically recovered after lock-time: {}", _0)]
AutoRecoverableAfter(u64),
}

/// Represents the amount of a coin locked by ongoing swap
#[derive(Debug)]
pub struct LockedAmount {
Expand Down
Loading
Loading