Skip to content

Commit 2a513fa

Browse files
committed
f monotonic clockish
1 parent 9eba077 commit 2a513fa

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lightning/src/ln/peer_handler.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,9 @@ impl<Descriptor: SocketDescriptor, CM: Deref, OM: Deref, L: Deref> PeerManager<D
559559
/// ephemeral_random_data is used to derive per-connection ephemeral keys and must be
560560
/// cryptographically secure random bytes.
561561
///
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.
565565
///
566566
/// (C-not exported) as we can't export a PeerManager with a dummy route handler
567567
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,
581581
/// generate error messages). Note that some other lightning implementations time-out connections
582582
/// after some time if no channel is built with the peer.
583583
///
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.
587587
///
588588
/// ephemeral_random_data is used to derive per-connection ephemeral keys and must be
589589
/// cryptographically secure random bytes.
@@ -649,9 +649,9 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
649649
/// ephemeral_random_data is used to derive per-connection ephemeral keys and must be
650650
/// cryptographically secure random bytes.
651651
///
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.
655655
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 {
656656
let mut ephemeral_key_midstate = Sha256::engine();
657657
ephemeral_key_midstate.input(ephemeral_random_data);

0 commit comments

Comments
 (0)