Skip to content

Commit

Permalink
ref: update latest l1 block on exit only
Browse files Browse the repository at this point in the history
  • Loading branch information
zeapoz committed Oct 20, 2023
1 parent 1918eb1 commit 37fe54f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/l1_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ impl L1Fetcher {
if (disable_polling && current_l1_block_number > end_block_number)
|| shutdown_rx.try_recv().is_ok()
{
// Store our current L1 block number so we can resume from where we left
// off.
if let Some(snapshot) = &snapshot_clone {
snapshot.lock().await.latest_l1_block_number = current_l1_block_number;
}
break;
}

Expand Down Expand Up @@ -273,11 +278,6 @@ impl L1Fetcher {
continue;
};

// Store our current L1 block number so we can resume if the process exits.
if let Some(snapshot) = &snapshot_clone {
snapshot.lock().await.latest_l1_block_number = current_l1_block_number;
}

metrics.lock().await.latest_l1_block_nbr = current_l1_block_number.as_u64();

// Increment current block index.
Expand Down

0 comments on commit 37fe54f

Please sign in to comment.