diff --git a/mm2src/mm2_main/src/lp_swap/swap_v2_common.rs b/mm2src/mm2_main/src/lp_swap/swap_v2_common.rs index b670163cd5..fd897507b6 100644 --- a/mm2src/mm2_main/src/lp_swap/swap_v2_common.rs +++ b/mm2src/mm2_main/src/lp_swap/swap_v2_common.rs @@ -379,32 +379,29 @@ pub(super) async fn swap_kickstart_handler_for_maker( storage: MakerSwapStorage, uuid: Uuid, ) { - let (maker_coin, taker_coin) = match swap_kickstart_coins(&ctx, &swap_repr, &uuid).await { - Some(coins) => coins, - None => return, - }; - - match (maker_coin, taker_coin) { - (MmCoinEnum::UtxoCoin(m), MmCoinEnum::UtxoCoin(t)) => { - swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await - }, - (MmCoinEnum::EthCoin(m), MmCoinEnum::EthCoin(t)) => { - swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await - }, - (MmCoinEnum::UtxoCoin(m), MmCoinEnum::EthCoin(t)) => { - swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await - }, - (MmCoinEnum::EthCoin(m), MmCoinEnum::UtxoCoin(t)) => { - swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await - }, - _ => { - error!( - "V2 swaps are not currently supported for {}/{} pair", - swap_repr.maker_coin(), - swap_repr.taker_coin() - ); - }, - }; + if let Some((maker_coin, taker_coin)) = swap_kickstart_coins(&ctx, &swap_repr, &uuid).await { + match (maker_coin, taker_coin) { + (MmCoinEnum::UtxoCoin(m), MmCoinEnum::UtxoCoin(t)) => { + swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await + }, + (MmCoinEnum::EthCoin(m), MmCoinEnum::EthCoin(t)) => { + swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await + }, + (MmCoinEnum::UtxoCoin(m), MmCoinEnum::EthCoin(t)) => { + swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await + }, + (MmCoinEnum::EthCoin(m), MmCoinEnum::UtxoCoin(t)) => { + swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await + }, + _ => { + error!( + "V2 swaps are not currently supported for {}/{} pair", + swap_repr.maker_coin(), + swap_repr.taker_coin() + ); + }, + } + } } pub(super) async fn swap_kickstart_handler_for_taker( @@ -413,30 +410,27 @@ pub(super) async fn swap_kickstart_handler_for_taker( storage: TakerSwapStorage, uuid: Uuid, ) { - let (maker_coin, taker_coin) = match swap_kickstart_coins(&ctx, &swap_repr, &uuid).await { - Some(coins) => coins, - None => return, - }; - - match (maker_coin, taker_coin) { - (MmCoinEnum::UtxoCoin(m), MmCoinEnum::UtxoCoin(t)) => { - swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await - }, - (MmCoinEnum::EthCoin(m), MmCoinEnum::EthCoin(t)) => { - swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await - }, - (MmCoinEnum::UtxoCoin(m), MmCoinEnum::EthCoin(t)) => { - swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await - }, - (MmCoinEnum::EthCoin(m), MmCoinEnum::UtxoCoin(t)) => { - swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await - }, - _ => { - error!( - "V2 swaps are not currently supported for {}/{} pair", - swap_repr.maker_coin(), - swap_repr.taker_coin() - ); - }, - }; + if let Some((maker_coin, taker_coin)) = swap_kickstart_coins(&ctx, &swap_repr, &uuid).await { + match (maker_coin, taker_coin) { + (MmCoinEnum::UtxoCoin(m), MmCoinEnum::UtxoCoin(t)) => { + swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await + }, + (MmCoinEnum::EthCoin(m), MmCoinEnum::EthCoin(t)) => { + swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await + }, + (MmCoinEnum::UtxoCoin(m), MmCoinEnum::EthCoin(t)) => { + swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await + }, + (MmCoinEnum::EthCoin(m), MmCoinEnum::UtxoCoin(t)) => { + swap_kickstart_handler::, _, _>(swap_repr, storage, uuid, m, t).await + }, + _ => { + error!( + "V2 swaps are not currently supported for {}/{} pair", + swap_repr.maker_coin(), + swap_repr.taker_coin() + ); + }, + } + } }