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.
pull/12/head
Lucas Soriano del Pino 4 years ago
parent 1251681cfd
commit bae391ff9c

@ -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))?;

Loading…
Cancel
Save