\#339 addendum

This commit is contained in:
Luke Parker
2023-11-15 20:23:19 -05:00
parent d25e3d86a2
commit 369af0fab5
10 changed files with 225 additions and 71 deletions

View File

@@ -30,7 +30,7 @@ use tokio::{sync::mpsc, time::sleep};
use crate::{
Db,
processors::Processors,
tributary::{TributarySpec, TributaryDb},
tributary::{TributarySpec, SeraiBlockNumber, TributaryDb},
};
mod db;
@@ -456,6 +456,16 @@ async fn handle_new_blocks<D: Db, Pro: Processors>(
let maximally_latent_cosign_block =
skipped_block.map(|skipped_block| skipped_block + COSIGN_DISTANCE);
for block in (last_intended_to_cosign_block + 1) ..= latest_number {
SeraiBlockNumber::set(
&mut txn,
serai
.block_by_number(block)
.await?
.expect("couldn't get block which should've been finalized")
.hash(),
&block,
);
let mut set = false;
let block_has_events = block_has_events(&mut txn, serai, block).await?;