From 92def54680eb8b7cb03227f410168fd37626d931 Mon Sep 17 00:00:00 2001 From: arya2 Date: Wed, 18 Oct 2023 14:41:32 -0400 Subject: [PATCH] avoids panic when checkpoints are missing --- zebra-state/src/service.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zebra-state/src/service.rs b/zebra-state/src/service.rs index f36cb488ec2..7ec6ce07180 100644 --- a/zebra-state/src/service.rs +++ b/zebra-state/src/service.rs @@ -389,8 +389,7 @@ impl StateService { let full_verifier_utxo_lookahead = max_checkpoint_height - HeightDiff::try_from(checkpoint_verify_concurrency_limit) .expect("fits in HeightDiff"); - let full_verifier_utxo_lookahead = - full_verifier_utxo_lookahead.expect("unexpected negative height"); + let full_verifier_utxo_lookahead = full_verifier_utxo_lookahead.unwrap_or(block::Height(0)); let non_finalized_state_queued_blocks = QueuedBlocks::default(); let pending_utxos = PendingUtxos::default();