]> git.bitcoin.ninja Git - rust-lightning/commitdiff
f rename awaiting_pong_tick_intervals for clarity
authorMatt Corallo <git@bluematt.me>
Thu, 28 Oct 2021 17:32:10 +0000 (17:32 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 28 Oct 2021 18:26:10 +0000 (18:26 +0000)
lightning/src/ln/peer_handler.rs

index a51c7ea524e34a9c4452d9a18fdc56d953213ad4..afc7f1438e897dc4feb5bf0865f51ef30034da1a 100644 (file)
@@ -860,7 +860,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref, CMH: Deref> P
                                                                        let features = InitFeatures::known();
                                                                        let resp = msgs::Init { features };
                                                                        self.enqueue_message(peer, &resp);
-                                                                       peer.awaiting_pong_tick_intervals = 0;
+                                                                       peer.awaiting_pong_timer_tick_intervals = 0;
                                                                },
                                                                NextNoiseStep::ActThree => {
                                                                        let their_node_id = try_potential_handleerror!(peer.channel_encryptor.process_act_three(&peer.pending_read_buffer[..]));
@@ -871,7 +871,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref, CMH: Deref> P
                                                                        let features = InitFeatures::known();
                                                                        let resp = msgs::Init { features };
                                                                        self.enqueue_message(peer, &resp);
-                                                                       peer.awaiting_pong_tick_intervals = 0;
+                                                                       peer.awaiting_pong_timer_tick_intervals = 0;
                                                                },
                                                                NextNoiseStep::NoiseComplete => {
                                                                        if peer.pending_read_is_header {
@@ -1536,26 +1536,26 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref, CMH: Deref> P
                                if !peer.channel_encryptor.is_ready_for_encryption() || peer.their_node_id.is_none() {
                                        // The peer needs to complete its handshake before we can exchange messages. We
                                        // give peers one timer tick to complete handshake, reusing
-                                       // `awaiting_pong_tick_intervals` to track number of timer ticks taken for
-                                       // handshake completion.
-                                       if peer.awaiting_pong_tick_intervals != 0 {
+                                       // `awaiting_pong_timer_tick_intervals` to track number of timer ticks taken
+                                       // for handshake completion.
+                                       if peer.awaiting_pong_timer_tick_intervals != 0 {
                                                do_disconnect_peer = true;
                                        } else {
-                                               peer.awaiting_pong_tick_intervals = 1;
+                                               peer.awaiting_pong_timer_tick_intervals = 1;
                                                return true;
                                        }
                                }
 
-                               if peer.awaiting_pong_tick_intervals == -1 {
+                               if peer.awaiting_pong_timer_tick_intervals == -1 {
                                        // Magic value set in `maybe_send_extra_ping`.
-                                       peer.awaiting_pong_tick_intervals = 1;
+                                       peer.awaiting_pong_timer_tick_intervals = 1;
                                        peer.received_message_since_timer_tick = false;
                                        return true;
                                }
 
                                if do_disconnect_peer
-                                       || (peer.awaiting_pong_timertick_intervals > 0 && !peer.received_message_since_timer_tick)
-                                       || peer.awaiting_pong_timertick_intervals as u64 >
+                                       || (peer.awaiting_pong_timer_tick_intervals > 0 && !peer.received_message_since_timer_tick)
+                                       || peer.awaiting_pong_timer_tick_intervals as u64 >
                                                MAX_BUFFER_DRAIN_TICK_INTERVALS_PER_PEER as u64 * peer_count as u64
                                {
                                        descriptors_needing_disconnect.push(descriptor.clone());