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 e1504a2463
commit 525417d660
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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)