← Watch feed
Rename `PeerManager::peer_should_read` for clarity
What changed, and why it matters
This commit simply renames an internal method from `peer_should_read` to `should_read_from` to make its purpose clearer. No behavior, logic, or security properties of the code are changed.
Recommended action
No security action needed; this is a non-functional refactoring change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is a pure identifier rename of a private PeerManager helper method and its two call sites. The method body, callers’ surrounding logic, and all control flow remain identical. There are no functional changes.
Changed components
lightning/src/ln/peer_handler.rsInspect captured patch +3 / −3
diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs
index 19b4b9e..74f081b 100644
--- a/lightning/src/ln/peer_handler.rs
+++ b/lightning/src/ln/peer_handler.rs
@@ -1527,7 +1527,7 @@ where
}
}
- fn peer_should_read(&self, peer: &mut Peer) -> bool {
+ fn should_read_from(&self, peer: &mut Peer) -> bool {
peer.should_read(self.gossip_processing_backlogged.load(Ordering::Relaxed))
}
@@ -1546,7 +1546,7 @@ where
// vice versa, then we need to tell the socket driver to update their internal flag
// indicating whether or not reads are paused. Do this by forcing a write with the desired
// `continue_read` flag set, even if no outbound messages are currently queued.
- force_one_write |= self.peer_should_read(peer) == peer.sent_pause_read;
+ force_one_write |= self.should_read_from(peer) == peer.sent_pause_read;
while force_one_write || !peer.awaiting_write_event {
if peer.should_buffer_onion_message() {
if let Some((peer_node_id, _)) = peer.their_node_id {
@@ -1612,7 +1612,7 @@ where
self.maybe_send_extra_ping(peer);
}
- let should_read = self.peer_should_read(peer);
+ let should_read = self.should_read_from(peer);
let next_buff = match peer.pending_outbound_buffer.front() {
None => {
if force_one_write {
Risk score
Our methodology →Why this scored 15/100
Human-validated context
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
No validated notes yet.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.