Skip to content

Commit

Permalink
identify/handler: Improve property name (#2639)
Browse files Browse the repository at this point in the history
  • Loading branch information
elenaf9 authored May 11, 2022
1 parent 5cf6890 commit f04f6bb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions protocols/identify/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ pub struct IdentifyHandler {
>,

/// Future that fires when we need to identify the node again.
next_id: Delay,
trigger_next_identify: Delay,

/// Whether the handler should keep the connection alive.
keep_alive: KeepAlive,

/// The interval of `next_id`, i.e. the recurrent delay.
/// The interval of `trigger_next_identify`, i.e. the recurrent delay.
interval: Duration,
}

Expand All @@ -81,7 +81,7 @@ impl IdentifyHandler {
pub fn new(initial_delay: Duration, interval: Duration) -> Self {
IdentifyHandler {
events: SmallVec::new(),
next_id: Delay::new(initial_delay),
trigger_next_identify: Delay::new(initial_delay),
keep_alive: KeepAlive::Yes,
interval,
}
Expand Down Expand Up @@ -165,7 +165,7 @@ impl ConnectionHandler for IdentifyHandler {
IdentifyHandlerEvent::IdentificationError(err),
));
self.keep_alive = KeepAlive::No;
self.next_id.reset(self.interval);
self.trigger_next_identify.reset(self.interval);
}

fn connection_keep_alive(&self) -> KeepAlive {
Expand All @@ -188,10 +188,10 @@ impl ConnectionHandler for IdentifyHandler {
}

// Poll the future that fires when we need to identify the node again.
match Future::poll(Pin::new(&mut self.next_id), cx) {
match Future::poll(Pin::new(&mut self.trigger_next_identify), cx) {
Poll::Pending => Poll::Pending,
Poll::Ready(()) => {
self.next_id.reset(self.interval);
self.trigger_next_identify.reset(self.interval);
let ev = ConnectionHandlerEvent::OutboundSubstreamRequest {
protocol: SubstreamProtocol::new(EitherUpgrade::A(IdentifyProtocol), ()),
};
Expand Down

0 comments on commit f04f6bb

Please sign in to comment.