Skip to content

Commit

Permalink
chore: a clearer comment and match pattern
Browse files Browse the repository at this point in the history
When checking for a local copy of content requested by a peer, the
comment explaining the case for missing content should match the order
of the pattern. Also, the pattern itself is made a little clearer.
  • Loading branch information
carver committed Sep 13, 2024
1 parent bad2ca3 commit 279d788
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions portalnet/src/overlay/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -971,9 +971,9 @@ where
Ok(Content::ConnectionId(cid_send.to_be()))
}
}
// If we don't have data to send back or can't obtain a permit, send the requester a
// If we can't obtain a permit or don't have data to send back, send the requester a
// list of closer ENRs.
(Ok(Some(_)), _) | (Ok(None), _) => {
(Ok(_), None) | (Ok(None), _) => {
let mut enrs = self.find_nodes_close_to_content(content_key);
enrs.retain(|enr| source != &enr.node_id());
pop_while_ssz_bytes_len_gt(&mut enrs, MAX_PORTAL_CONTENT_PAYLOAD_SIZE);
Expand Down

0 comments on commit 279d788

Please sign in to comment.