From bae391ff9c5198e4017403db100607c1cc7207c0 Mon Sep 17 00:00:00 2001 From: Lucas Soriano del Pino Date: Fri, 16 Oct 2020 11:43:24 +1100 Subject: [PATCH] Bubble up unrecoverable errors instead of expecting This does introduce the ability of expressing incorrect combinations of the enums `SwapFailed` and `Reason`, but these are just internal to this function and it's terser that way. --- xmr-btc/src/lib.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/xmr-btc/src/lib.rs b/xmr-btc/src/lib.rs index f07fa774..99cc8405 100644 --- a/xmr-btc/src/lib.rs +++ b/xmr-btc/src/lib.rs @@ -224,8 +224,6 @@ where Either::Right(_) => return Err(SwapFailed::AfterBtcLock(Reason::BtcExpired)), }; - // NOTE: If any of this fails, Bob will never be able to take the monero. - // Therefore, there is no way to handle these errors other than aborting let tx_redeem_sig = tx_redeem .extract_signature_by_key(tx_redeem_published, b.public()) .map_err(|_| SwapFailed::AfterBtcRedeem(Reason::BtcRedeemSignature))?;