mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
fix: poll_tick does not register waker if ready (#2276)
This commit is contained in:
@ -1408,12 +1408,14 @@ impl Discv4Service {
|
||||
|
||||
// trigger self lookup
|
||||
if self.config.enable_lookup && self.lookup_interval.poll_tick(cx).is_ready() {
|
||||
let _ = self.lookup_interval.poll_tick(cx);
|
||||
let target = self.lookup_rotator.next(&self.local_node_record.id);
|
||||
self.lookup_with(target, None);
|
||||
}
|
||||
|
||||
// re-ping some peers
|
||||
if self.ping_interval.poll_tick(cx).is_ready() {
|
||||
let _ = self.ping_interval.poll_tick(cx);
|
||||
self.re_ping_oldest();
|
||||
}
|
||||
|
||||
|
||||
@ -715,6 +715,8 @@ impl PeersManager {
|
||||
}
|
||||
|
||||
if self.refill_slots_interval.poll_tick(cx).is_ready() {
|
||||
// this ensures the manager will be polled periodically, see [Interval::poll_tick]
|
||||
let _ = self.refill_slots_interval.poll_tick(cx);
|
||||
self.fill_outbound_slots();
|
||||
}
|
||||
|
||||
|
||||
@ -596,6 +596,7 @@ impl Future for ActiveSession {
|
||||
|
||||
if !progress {
|
||||
if this.internal_request_timeout_interval.poll_tick(cx).is_ready() {
|
||||
let _ = this.internal_request_timeout_interval.poll_tick(cx);
|
||||
// check for timed out requests
|
||||
if this.check_timed_out_requests(Instant::now()) {
|
||||
let _ = this.to_session.clone().try_send(
|
||||
|
||||
@ -262,6 +262,7 @@ where
|
||||
this.pending_block.is_none() &&
|
||||
!deadline_reached
|
||||
{
|
||||
let _ = this.interval.poll_tick(cx);
|
||||
trace!("spawn new payload build task");
|
||||
let (tx, rx) = oneshot::channel();
|
||||
let client = this.client.clone();
|
||||
|
||||
Reference in New Issue
Block a user