Minor buig fixes

This commit is contained in:
Godmode Galactus 2023-09-08 13:55:17 +02:00
parent d025d957a6
commit 3e4ec00f0a
No known key found for this signature in database
GPG Key ID: A04142C71ABB0DEA
2 changed files with 8 additions and 7 deletions

View File

@ -172,7 +172,7 @@ pub fn poll_block(
let task_spawner: AnyhowJoinHandle = tokio::spawn(async move { let task_spawner: AnyhowJoinHandle = tokio::spawn(async move {
let counting_semaphore = Arc::new(tokio::sync::Semaphore::new(1024)); let counting_semaphore = Arc::new(tokio::sync::Semaphore::new(1024));
let mut slot_notification = slot_notification; 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 { loop {
let SlotNotification { processed_slot, .. } = slot_notification let SlotNotification { processed_slot, .. } = slot_notification
.recv() .recv()

View File

@ -84,13 +84,14 @@ pub fn poll_slots(
// this is because it may be a slot block // this is because it may be a slot block
if estimated_slot < current_slot + 32 { if estimated_slot < current_slot + 32 {
estimated_slot += 1; 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")?;
} }
} }
} }