Skip to content

Commit

Permalink
feat(kademlia): Forbid to use Provider API
Browse files Browse the repository at this point in the history
  • Loading branch information
gurinderu committed Feb 14, 2023
1 parent d15c084 commit 626ccbe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/kademlia/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use libp2p::core::connection::ConnectionId;
use libp2p::core::transport::ListenerId;
use libp2p::core::ConnectedPoint;
use libp2p::kad::kbucket::Key;
use libp2p::kad::KademliaStoreInserts;
use libp2p::swarm::behaviour::{
ConnectionClosed, ConnectionEstablished, DialFailure, ExpiredExternalAddr, ExpiredListenAddr,
FromSwarm, ListenFailure, ListenerClosed, ListenerError, NewExternalAddr, NewListenAddr,
Expand Down Expand Up @@ -130,7 +131,9 @@ impl Kademlia {
let timer = Delay::new(config.query_timeout);

let store = MemoryStore::new(config.peer_id);
let kademlia = kad::Kademlia::with_config(config.peer_id, store, config.as_libp2p());
let mut kad_config = config.as_libp2p();
kad_config.set_record_filtering(KademliaStoreInserts::FilterBoth);
let kademlia = kad::Kademlia::with_config(config.peer_id, store, kad_config);

let (outlet, commands) = mpsc::unbounded();
let api = KademliaApi { outlet };
Expand Down

0 comments on commit 626ccbe

Please sign in to comment.