Minor compilation changes
This commit is contained in:
parent
3e4ec00f0a
commit
797ed8d556
|
@ -172,13 +172,18 @@ 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(rpc_client.get_slot()));
|
let current_slot = Arc::new(AtomicU64::new(0));
|
||||||
loop {
|
loop {
|
||||||
let SlotNotification { processed_slot, .. } = slot_notification
|
let SlotNotification { processed_slot, .. } = slot_notification
|
||||||
.recv()
|
.recv()
|
||||||
.await
|
.await
|
||||||
.context("Slot notification channel close")?;
|
.context("Slot notification channel close")?;
|
||||||
let last_processed_slot = current_slot.load(std::sync::atomic::Ordering::Relaxed);
|
let last_processed_slot = current_slot.load(std::sync::atomic::Ordering::Relaxed);
|
||||||
|
let last_processed_slot = if last_processed_slot == 0 {
|
||||||
|
last_processed_slot.saturating_sub(1)
|
||||||
|
} else {
|
||||||
|
last_processed_slot
|
||||||
|
};
|
||||||
if processed_slot > last_processed_slot {
|
if processed_slot > last_processed_slot {
|
||||||
current_slot.store(processed_slot, std::sync::atomic::Ordering::Relaxed);
|
current_slot.store(processed_slot, std::sync::atomic::Ordering::Relaxed);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue