-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
priority: lowNice-to-have improvements, optimizations, or future considerationsNice-to-have improvements, optimizations, or future considerationstodoExtracted from code todosExtracted from code todos
Description
This pattern is implemented in multiple places:
litep2p/src/protocol/libp2p/kademlia/routing_table.rs
Lines 145 to 156 in e0b7118
| // TODO: this has to be moved elsewhere at some point | |
| let addresses: Vec<Multiaddr> = addresses | |
| .into_iter() | |
| .filter_map(|address| { | |
| let last = address.iter().last(); | |
| if std::matches!(last, Some(Protocol::P2p(_))) { | |
| Some(address) | |
| } else { | |
| Some(address.with(Protocol::P2p(Multihash::from_bytes(&peer.to_bytes()).ok()?))) | |
| } | |
| }) | |
| .collect(); |
Metadata
Metadata
Assignees
Labels
priority: lowNice-to-have improvements, optimizations, or future considerationsNice-to-have improvements, optimizations, or future considerationstodoExtracted from code todosExtracted from code todos