Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
gurinderu committed Feb 14, 2023
1 parent 626ccbe commit c0c840d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/kademlia/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ impl Kademlia {

let store = MemoryStore::new(config.peer_id);
let mut kad_config = config.as_libp2p();
// By default, all records from peers are automatically stored.
// `FilterBoth` means it's the Kademlia behaviour handler's responsibility
// to determine whether or not Provider records and KV records ("both") get stored,
// where we implement logic to validate/prune incoming records.
kad_config.set_record_filtering(KademliaStoreInserts::FilterBoth);
let kademlia = kad::Kademlia::with_config(config.peer_id, store, kad_config);

Expand Down

0 comments on commit c0c840d

Please sign in to comment.