File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 88
99- Derive ` Serialize ` , ` Deserialize ` for ` store::record::Key ` (see [ PR 2408] )
1010
11+ - Add ` get_closest_local_peers ` to ` Kademlia ` (see [ PR 2436] )
12+
1113[ PR 2339 ] : https://github.com/libp2p/rust-libp2p/pull/2339
1214[ PR 2411 ] : https://github.com/libp2p/rust-libp2p/pull/2411
1315[ PR 2408 ] : https://github.com/libp2p/rust-libp2p/pull/2408
16+ [ PR 2436 ] : https://github.com/libp2p/rust-libp2p/pull/2436
1417
1518# 0.33.0 [ 2021-11-16]
1619
Original file line number Diff line number Diff line change @@ -667,6 +667,14 @@ where
667667 self . queries . add_iter_closest ( target. clone ( ) , peers, inner)
668668 }
669669
670+ /// Returns closest peers to the given key; takes peers from local routing table only.
671+ pub fn get_closest_local_peers < ' a , K : Clone > (
672+ & ' a mut self ,
673+ key : & ' a kbucket:: Key < K > ,
674+ ) -> impl Iterator < Item = kbucket:: Key < PeerId > > + ' a {
675+ self . kbuckets . closest_keys ( key)
676+ }
677+
670678 /// Performs a lookup for a record in the DHT.
671679 ///
672680 /// The result of this operation is delivered in a
You can’t perform that action at this time.
0 commit comments