fix(hardano): exclude last chunk file during immutable db read (#454)

This commit is contained in:
Alex Pozhylenkov 2024-05-14 13:10:14 +03:00 committed by GitHub
parent af8898b8ec
commit 1a927ee1a0

View file

@ -118,6 +118,10 @@ fn build_stack_of_chunk_names(dir: &Path) -> Result<ChunkNameSack, std::io::Erro
.collect::<Vec<_>>();
chunks.sort();
// According to this docs https://mithril.network/doc/glossary/#immutable-file-number,
// the last chunk files are not really immutable.
// So to preserve only immutable data the last chunk files are omitted.
chunks.pop();
chunks.reverse();
Ok(chunks)