Skip to content

Commit

Permalink
chore: misc update
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 committed Dec 2, 2024
1 parent 399dc35 commit f19c8a9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions extensions/warp-ipfs/src/store/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,11 +591,13 @@ impl DiscoveryTask {
.filter_map(|addr| addr.clone().extract_peer_id())
.collect::<IndexSet<_>>();

if !peers.is_empty() {
if peers.is_empty() {
// We will use the first instance instead of the whole set for now
let peer_id = peers.get_index(0).copied().expect("should not fail");
self.rz_discovery(namespace, peer_id);
return;
}

let peer_id = peers.get_index(0).copied().expect("should not fail");
self.rz_discovery(namespace, peer_id);
}
}
}
Expand Down Expand Up @@ -625,8 +627,9 @@ impl DiscoveryTask {
.boxed(),
DiscoveryType::RzPoint { addresses } => {
let peers = addresses
.iter()
.filter_map(|addr| addr.clone().extract_peer_id())
.clone()
.into_iter()
.filter_map(|mut addr| addr.extract_peer_id())
.collect::<IndexSet<_>>();

if peers.is_empty() {
Expand Down

0 comments on commit f19c8a9

Please sign in to comment.