Update processor message flow around the new SignedBatch flow

This commit is contained in:
Luke Parker
2023-04-10 02:51:15 -04:00
parent ccec529cee
commit b9f38fb354
10 changed files with 213 additions and 98 deletions

View File

@@ -232,6 +232,10 @@ impl<C: Coin, D: Db> ScannerHandle<C, D> {
scanner.keys.push(key);
}
pub async fn block_number(&self, id: &<C::Block as Block<C>>::Id) -> Option<usize> {
self.scanner.read().await.db.block_number(id)
}
/// Acknowledge having handled a block for a key.
pub async fn ack_block(
&self,
@@ -341,7 +345,7 @@ impl<C: Coin, D: Db> Scanner<C, D> {
if let Some(id) = scanner.db.block(i) {
// TODO2: Also check this block builds off the previous block
if id != block.id() {
if id != block_id {
panic!("{} reorg'd from {id:?} to {:?}", C::ID, hex::encode(block_id));
}
} else {