Skip to content

Commit 4392a9d

Browse files
authored
Merge pull request #3865 from TheBlueMatt/2025-06-3725-followups
Misc `peer_handler.rs` cleanups and fixes
2 parents a55b3cf + 90d3961 commit 4392a9d

File tree

3 files changed

+164
-126
lines changed

3 files changed

+164
-126
lines changed

lightning/src/ln/channel.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6024,13 +6024,13 @@ where
60246024
2*(1 + 71); // two signatures + sighash type flags
60256025
if let Some(spk) = a_scriptpubkey {
60266026
ret += ((8+1) + // output values and script length
6027-
spk.len() as u64)
6028-
* 4; // scriptpubkey and witness multiplier
6027+
spk.len() as u64) // scriptpubkey
6028+
* 4; // witness multiplier
60296029
}
60306030
if let Some(spk) = b_scriptpubkey {
60316031
ret += ((8+1) + // output values and script length
6032-
spk.len() as u64)
6033-
* 4; // scriptpubkey and witness multiplier
6032+
spk.len() as u64) // scriptpubkey
6033+
* 4; // witness multiplier
60346034
}
60356035
ret
60366036
}

lightning/src/ln/msgs.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,9 +1933,11 @@ pub trait BaseMessageHandler {
19331933

19341934
/// Handle a peer (re)connecting.
19351935
///
1936-
/// May return an `Err(())` if the features the peer supports are not sufficient to communicate
1937-
/// with us. Implementors should be somewhat conservative about doing so, however, as other
1938-
/// message handlers may still wish to communicate with this peer.
1936+
/// May return an `Err(())` to indicate that we should immediately disconnect from the peer
1937+
/// (e.g. because the features they support are not sufficient to communicate with us).
1938+
///
1939+
/// Note, of course, that other message handlers may wish to communicate with the peer, which
1940+
/// disconnecting them will prevent.
19391941
///
19401942
/// [`Self::peer_disconnected`] will not be called if `Err(())` is returned.
19411943
fn peer_connected(&self, their_node_id: PublicKey, msg: &Init, inbound: bool)

0 commit comments

Comments
 (0)