From 03dd327cc3635fc4114cd6ff87ba7995953db61e Mon Sep 17 00:00:00 2001 From: Ljubisa Isakovic <93769705+sh3ll3x3c@users.noreply.github.com> Date: Fri, 15 Dec 2023 13:50:30 +0100 Subject: [PATCH] fixed kad mode not being set properly to config value (#387) --- src/network/p2p.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/network/p2p.rs b/src/network/p2p.rs index 5cae80fcf..88cf08da9 100644 --- a/src/network/p2p.rs +++ b/src/network/p2p.rs @@ -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; @@ -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