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

Fix the truncate bug in Ship #9810

Merged
merged 1 commit into from
Dec 18, 2020
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
4 changes: 2 additions & 2 deletions libraries/state_history/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ void state_history_log::truncate(state_history_log::block_num_type block_num) {
uint64_t pos = get_pos(block_num);
write_log.seek(0);
index.seek(0);
boost::filesystem::resize_file(index.get_file_path(), pos);
boost::filesystem::resize_file(read_log.get_file_path(), (block_num - _begin_block) * sizeof(uint64_t));
boost::filesystem::resize_file(read_log.get_file_path(), pos);
boost::filesystem::resize_file(index.get_file_path(), (block_num - _begin_block) * sizeof(uint64_t));
_end_block = block_num;
}
write_log.flush();
Expand Down