Skip to content

Commit

Permalink
fixed kad mode not being set properly to config value (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
sh3ll3x3c authored Dec 15, 2023
1 parent 0ddc5d5 commit 03dd327
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/network/p2p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ mod kad_mem_store;

use crate::{
network::p2p::event_loop::IdentityData,
types::{LibP2PConfig, SecretKey},
types::{KademliaMode, LibP2PConfig, SecretKey},
};
pub use client::Client;
use event_loop::EventLoop;
Expand Down Expand Up @@ -202,6 +202,11 @@ pub fn init(
.build();

if is_fat_client {
swarm
.behaviour_mut()
.kademlia
.set_mode(Some(KademliaMode::Server.to_kad_mode()));
} else {
swarm
.behaviour_mut()
.kademlia
Expand Down

0 comments on commit 03dd327

Please sign in to comment.