@@ -559,9 +559,9 @@ impl<Descriptor: SocketDescriptor, CM: Deref, OM: Deref, L: Deref> PeerManager<D
559
559
/// ephemeral_random_data is used to derive per-connection ephemeral keys and must be
560
560
/// cryptographically secure random bytes.
561
561
///
562
- /// `current_time` should be set higher than any previous `PeerManager` instance with the same
563
- /// secret key. The simplest way to ensure this, of course, is to simply set it to the current
564
- /// UNIX timestamp on startup .
562
+ /// `current_time` is used as an always-increasing counter that survives across restarts and is
563
+ /// incremented irregularly internally. In general it is best to simply use the current UNIX
564
+ /// timestamp.
565
565
///
566
566
/// (C-not exported) as we can't export a PeerManager with a dummy route handler
567
567
pub fn new_channel_only ( channel_message_handler : CM , onion_message_handler : OM , our_node_secret : SecretKey , current_time : u64 , ephemeral_random_data : & [ u8 ; 32 ] , logger : L ) -> Self {
@@ -581,9 +581,9 @@ impl<Descriptor: SocketDescriptor, RM: Deref, L: Deref> PeerManager<Descriptor,
581
581
/// generate error messages). Note that some other lightning implementations time-out connections
582
582
/// after some time if no channel is built with the peer.
583
583
///
584
- /// `current_time` should be set higher than any previous `PeerManager` instance with the same
585
- /// secret key. The simplest way to ensure this, of course, is to simply set it to the current
586
- /// UNIX timestamp on startup .
584
+ /// `current_time` is used as an always-increasing counter that survives across restarts and is
585
+ /// incremented irregularly internally. In general it is best to simply use the current UNIX
586
+ /// timestamp.
587
587
///
588
588
/// ephemeral_random_data is used to derive per-connection ephemeral keys and must be
589
589
/// cryptographically secure random bytes.
@@ -649,9 +649,9 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
649
649
/// ephemeral_random_data is used to derive per-connection ephemeral keys and must be
650
650
/// cryptographically secure random bytes.
651
651
///
652
- /// `current_time` should be set higher than any previous `PeerManager` instance with the same
653
- /// secret key. The simplest way to ensure this, of course, is to simply set it to the current
654
- /// UNIX timestamp on startup .
652
+ /// `current_time` is used as an always-increasing counter that survives across restarts and is
653
+ /// incremented irregularly internally. In general it is best to simply use the current UNIX
654
+ /// timestamp.
655
655
pub fn new ( message_handler : MessageHandler < CM , RM , OM > , our_node_secret : SecretKey , current_time : u64 , ephemeral_random_data : & [ u8 ; 32 ] , logger : L , custom_message_handler : CMH ) -> Self {
656
656
let mut ephemeral_key_midstate = Sha256 :: engine ( ) ;
657
657
ephemeral_key_midstate. input ( ephemeral_random_data) ;
0 commit comments