mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-12-24 06:59:36 -05:00
Fail if user passes in local port for non-tor usage
Local port is only used when running behind tor. Fail if user passes a local port number when running in non-tor mode.
This commit is contained in:
parent
42d194f758
commit
464b699426
@ -125,7 +125,10 @@ fn new_swarm(listen: Multiaddr, port: Option<u16>) -> Result<Swarm> {
|
||||
}
|
||||
#[cfg(not(feature = "tor"))]
|
||||
{
|
||||
transport = transport::build(local_key_pair)?;
|
||||
transport = match port {
|
||||
None => transport::build(local_key_pair)?,
|
||||
Some(port) => anyhow::bail!("local port should not be provided for non-tor usage"),
|
||||
};
|
||||
}
|
||||
|
||||
let mut swarm = libp2p::swarm::SwarmBuilder::new(transport, behaviour, local_peer_id.clone())
|
||||
|
Loading…
Reference in New Issue
Block a user