Commit f96a5b39 authored by Eric Frias's avatar Eric Frias Committed by Dan Notestein
Browse files

Improve block log <-> index cross-checks at hived startup.

Only fully reconstruct the index when absolutely necessary.
If the index is longer than the block log, just truncate the index
to the right size.  If the index is shorter, just rebuild the
missing portion.
parent 774d36d0
This diff is collapsed.
......@@ -95,7 +95,7 @@ namespace hive { namespace chain {
fc::optional<uint8_t> dictionary_number = fc::optional<int>(),
fc::optional<ZSTD_DCtx*> decompression_context_for_reuse = fc::optional<ZSTD_DCtx*>());
private:
void construct_index( bool resume = false, uint64_t index_pos = 0 );
void construct_index(bool resume = false);
static std::tuple<std::unique_ptr<char[]>, size_t> decompress_raw_block(const char* raw_block_data, size_t raw_block_size, block_attributes_t attributes);
std::unique_ptr<detail::block_log_impl> my;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment