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

Commit

Permalink
Merge pull request #9811 from EOSIO/huangminghuang/fix-ship-truncate-…
Browse files Browse the repository at this point in the history
…2.1.x

Fix the truncate bug in Ship - 2.1
  • Loading branch information
brianjohnson5972 authored Dec 18, 2020
2 parents 0d48faf + 5f8df8d commit 7d8a44c
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 7d8a44c

Please sign in to comment.