Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

identify/handler: Improve property name #2639

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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