diff --git a/cluster-endpoints/src/rpc_polling/poll_blocks.rs b/cluster-endpoints/src/rpc_polling/poll_blocks.rs index 7240c617..b6785dd0 100644 --- a/cluster-endpoints/src/rpc_polling/poll_blocks.rs +++ b/cluster-endpoints/src/rpc_polling/poll_blocks.rs @@ -172,7 +172,7 @@ pub fn poll_block( let task_spawner: AnyhowJoinHandle = tokio::spawn(async move { let counting_semaphore = Arc::new(tokio::sync::Semaphore::new(1024)); let mut slot_notification = slot_notification; - let current_slot = Arc::new(AtomicU64::new(0)); + let current_slot = Arc::new(AtomicU64::new(rpc_client.get_slot())); loop { let SlotNotification { processed_slot, .. } = slot_notification .recv() diff --git a/cluster-endpoints/src/rpc_polling/poll_slots.rs b/cluster-endpoints/src/rpc_polling/poll_slots.rs index b2a922ce..fd363f4f 100644 --- a/cluster-endpoints/src/rpc_polling/poll_slots.rs +++ b/cluster-endpoints/src/rpc_polling/poll_slots.rs @@ -84,13 +84,14 @@ pub fn poll_slots( // this is because it may be a slot block if estimated_slot < current_slot + 32 { estimated_slot += 1; + + sender + .send(SlotNotification { + processed_slot: current_slot, + estimated_processed_slot: estimated_slot, + }) + .context("Connot send slot notification")?; } - sender - .send(SlotNotification { - processed_slot: current_slot, - estimated_processed_slot: estimated_slot, - }) - .context("Connot send slot notification")?; } } }