Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Fix bugs in block_log #7188

Merged
merged 1 commit into from
Apr 24, 2019
Merged

Fix bugs in block_log #7188

merged 1 commit into from
Apr 24, 2019

Conversation

arhag
Copy link
Contributor

@arhag arhag commented Apr 23, 2019

Change Description

This PR fixes two bugs in block_log.

First, it allows opening a non-empty block log that contains no blocks. This actually fixes undefined behavior that would lead to a segmentation fault when attempting to open a block log that contained no blocks.

Second, a check is added to construct_index to prevent an attempt to read a block when the block log is known to not contain any blocks. In this situation, instead of throwing an exception, construct_index will now correctly leave an empty index file.

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

…; contruct_index should leave index file empty if block log contains no blocks
@arhag arhag changed the base branch from forced-replay to develop April 24, 2019 15:05
@arhag arhag merged commit 4547a51 into develop Apr 24, 2019
@arhag arhag deleted the fix-block-log-bugs branch April 24, 2019 15:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants