Skip to content

Commit

Permalink
networking: Refactor the code.
Browse files Browse the repository at this point in the history
- add comments
  • Loading branch information
shamil-gadelshin committed Oct 10, 2023
1 parent db8cabb commit 82ee98a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion crates/subspace-networking/src/constructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ pub struct Config<LocalRecordProvider> {
pub special_target_connections: u32,
/// Addresses to bootstrap Kademlia network
pub bootstrap_addresses: Vec<Multiaddr>,
/// Kademlia mode.
/// Kademlia mode. The default value is set to Static(Client). The peer won't add its address
/// to other peers` Kademlia routing table. Changing this behaviour implies that a peer can
/// provide pieces to others.
pub kademlia_mode: KademliaMode,
/// Known external addresses to the local peer. The addresses will be added on the swarm start
/// and enable peer to notify others about its reachable address.
Expand Down
2 changes: 1 addition & 1 deletion crates/subspace-networking/src/node_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ where
if let AutonatEvent::StatusChanged { old, new } = event {
info!(?old, ?new, "Public address status changed.");

if let KademliaMode::Dynamic { .. } = self.kademlia_mode {
if matches!(self.kademlia_mode, KademliaMode::Dynamic { .. }) {
let mode = match &new {
NatStatus::Public(address) => {
if is_global_address_or_dns(address)
Expand Down

0 comments on commit 82ee98a

Please sign in to comment.