mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-01-23 13:51:08 -05:00
Simplify match statement
This code is unnecessarily complicated.
This commit is contained in:
parent
707bae9ff0
commit
f1182f97c0
@ -3,7 +3,6 @@ use crate::database::Database;
|
||||
use crate::env::Config;
|
||||
use crate::network::quote::BidQuote;
|
||||
use crate::network::transfer_proof;
|
||||
use crate::protocol::alice::spot_price::Error;
|
||||
use crate::protocol::alice::{AliceState, Behaviour, OutEvent, State0, State3, Swap};
|
||||
use crate::{bitcoin, kraken, monero};
|
||||
use anyhow::{Context, Result};
|
||||
@ -208,19 +207,7 @@ where
|
||||
self.swarm.behaviour_mut().execution_setup.run(peer, state0);
|
||||
}
|
||||
SwarmEvent::Behaviour(OutEvent::SwapRequestDeclined { peer, error }) => {
|
||||
match error {
|
||||
Error::ResumeOnlyMode
|
||||
| Error::AmountBelowMinimum { .. }
|
||||
| Error::AmountAboveMaximum { .. }
|
||||
| Error::BlockchainNetworkMismatch { .. } => {
|
||||
tracing::warn!(%peer, "Ignoring spot price request because: {}", error);
|
||||
}
|
||||
Error::BalanceTooLow { .. }
|
||||
| Error::LatestRateFetchFailed(_)
|
||||
| Error::SellQuoteCalculationFailed(_) => {
|
||||
tracing::error!(%peer, "Ignoring spot price request because: {}", error);
|
||||
}
|
||||
}
|
||||
tracing::warn!(%peer, "Ignoring spot price request because: {}", error);
|
||||
}
|
||||
SwarmEvent::Behaviour(OutEvent::QuoteRequested { channel, peer }) => {
|
||||
// TODO: Move the spot-price update into dedicated update stream to decouple it from quote requests
|
||||
|
Loading…
Reference in New Issue
Block a user