chore: allow missing total difficulty when loading node head (#14533)

This commit is contained in:
Matthias Seitz
2025-02-17 16:26:36 +01:00
committed by GitHub
parent 7fbeccca57
commit 41f0f01982

View File

@ -323,7 +323,9 @@ impl<ChainSpec> NodeConfig<ChainSpec> {
let total_difficulty = provider let total_difficulty = provider
.header_td_by_number(head)? .header_td_by_number(head)?
.expect("the total difficulty for the latest block is missing, database is corrupt"); // total difficulty is effectively deprecated, but still required in some places, e.g.
// p2p
.unwrap_or_default();
let hash = provider let hash = provider
.block_hash(head)? .block_hash(head)?