Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/node-persistent-cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ node_persistent_cache::node_persistent_cache(std::string file_name,
}

m_index = std::make_unique<index_t>(m_fd);

// First location must always be the undefined location, otherwise we
// might be looking at a different kind of file. This check here is for
// forwards compatibility. If and when we change the file format, we
// can use the first 8 bytes to differentiate the file format.
auto const loc = get(0);
if (loc.is_defined()) {
throw fmt_error("Not a version 1 flatnode file '{}'", m_file_name);
}
}

node_persistent_cache::~node_persistent_cache() noexcept
Expand Down
Loading