@@ -284,7 +284,7 @@ pub struct MessageHandler<CM: Deref, RM: Deref, OM: Deref> where
284
284
/// to a remote host. You will need to be able to generate multiple of these which meet Eq and
285
285
/// implement Hash to meet the PeerManager API.
286
286
///
287
- /// For efficiency, Clone should be relatively cheap for this type.
287
+ /// For efficiency, [` Clone`] should be relatively cheap for this type.
288
288
///
289
289
/// Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
290
290
/// has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
@@ -547,10 +547,10 @@ pub type SimpleRefPeerManager<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm
547
547
/// [`PeerManager`] functions related to the same connection must occur only in serial, making new
548
548
/// calls only after previous ones have returned.
549
549
///
550
- /// Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
551
- /// a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
552
- /// essentially you should default to using a SimpleRefPeerManager, and use a
553
- /// SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
550
+ /// Rather than using a plain [` PeerManager`] , it is preferable to use either a [` SimpleArcPeerManager`]
551
+ /// a [` SimpleRefPeerManager`] , for conciseness. See their documentation for more details, but
552
+ /// essentially you should default to using a [` SimpleRefPeerManager`] , and use a
553
+ /// [` SimpleArcPeerManager`] when you require a ` PeerManager` with a static lifetime, such as when
554
554
/// you're using lightning-net-tokio.
555
555
///
556
556
/// [`read_event`]: PeerManager::read_event
@@ -638,7 +638,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, OM: Deref, L: Deref, NS: Deref> Pe
638
638
/// `OnionMessageHandler`. No routing message handler is used and network graph messages are
639
639
/// ignored.
640
640
///
641
- /// ephemeral_random_data is used to derive per-connection ephemeral keys and must be
641
+ /// ` ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
642
642
/// cryptographically secure random bytes.
643
643
///
644
644
/// `current_time` is used as an always-increasing counter that survives across restarts and is
@@ -670,7 +670,7 @@ impl<Descriptor: SocketDescriptor, RM: Deref, L: Deref, NS: Deref> PeerManager<D
670
670
/// timestamp, however if it is not available a persistent counter that increases once per
671
671
/// minute should suffice.
672
672
///
673
- /// ephemeral_random_data is used to derive per-connection ephemeral keys and must be
673
+ /// ` ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
674
674
/// cryptographically secure random bytes.
675
675
///
676
676
/// (C-not exported) as we can't export a PeerManager with a dummy channel handler
@@ -732,8 +732,9 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
732
732
CMH :: Target : CustomMessageHandler ,
733
733
NS :: Target : NodeSigner
734
734
{
735
- /// Constructs a new PeerManager with the given message handlers and node_id secret key
736
- /// ephemeral_random_data is used to derive per-connection ephemeral keys and must be
735
+ /// Constructs a new `PeerManager` with the given message handlers.
736
+ ///
737
+ /// `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
737
738
/// cryptographically secure random bytes.
738
739
///
739
740
/// `current_time` is used as an always-increasing counter that survives across restarts and is
@@ -806,9 +807,9 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
806
807
/// Returns a small number of bytes to send to the remote node (currently always 50).
807
808
///
808
809
/// Panics if descriptor is duplicative with some other descriptor which has not yet been
809
- /// [`socket_disconnected() `].
810
+ /// [`socket_disconnected`].
810
811
///
811
- /// [`socket_disconnected() `]: PeerManager::socket_disconnected
812
+ /// [`socket_disconnected`]: PeerManager::socket_disconnected
812
813
pub fn new_outbound_connection ( & self , their_node_id : PublicKey , descriptor : Descriptor , remote_network_address : Option < NetAddress > ) -> Result < Vec < u8 > , PeerHandleError > {
813
814
let mut peer_encryptor = PeerChannelEncryptor :: new_outbound ( their_node_id. clone ( ) , self . get_ephemeral_key ( ) ) ;
814
815
let res = peer_encryptor. get_act_one ( & self . secp_ctx ) . to_vec ( ) ;
@@ -863,9 +864,9 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
863
864
/// the connection immediately.
864
865
///
865
866
/// Panics if descriptor is duplicative with some other descriptor which has not yet been
866
- /// [`socket_disconnected() `].
867
+ /// [`socket_disconnected`].
867
868
///
868
- /// [`socket_disconnected() `]: PeerManager::socket_disconnected
869
+ /// [`socket_disconnected`]: PeerManager::socket_disconnected
869
870
pub fn new_inbound_connection ( & self , descriptor : Descriptor , remote_network_address : Option < NetAddress > ) -> Result < ( ) , PeerHandleError > {
870
871
let peer_encryptor = PeerChannelEncryptor :: new_inbound ( & self . node_signer ) ;
871
872
let pending_read_buffer = [ 0 ; 50 ] . to_vec ( ) ; // Noise act one is 50 bytes
@@ -1011,7 +1012,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
1011
1012
/// May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
1012
1013
/// returning. Thus, be very careful with reentrancy issues! The invariants around calling
1013
1014
/// [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
1014
- /// ready to call `[ write_buffer_space_avail`] again if a write call generated here isn't
1015
+ /// ready to call [` write_buffer_space_avail`] again if a write call generated here isn't
1015
1016
/// sufficient!
1016
1017
///
1017
1018
/// [`send_data`]: SocketDescriptor::send_data
0 commit comments