From c0c840d27b3525daff6fb40ad0eb4d12c00570e6 Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 14 Feb 2023 16:01:39 +0300 Subject: [PATCH] add comment --- crates/kademlia/src/behaviour.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/kademlia/src/behaviour.rs b/crates/kademlia/src/behaviour.rs index 362a793722..4487f12f5d 100644 --- a/crates/kademlia/src/behaviour.rs +++ b/crates/kademlia/src/behaviour.rs @@ -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);