Skip to content

Commit

Permalink
Fix size calculation in replay status message
Browse files Browse the repository at this point in the history
  • Loading branch information
abitmore authored Aug 22, 2020
1 parent ebab03a commit a6ed3c3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libraries/chain/db_management.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,15 @@ void database::reindex( fc::path data_dir )
{
std::stringstream bysize;
std::stringstream bynum;
bysize << std::fixed << std::setprecision(5) << double(std::get<0>(blocks.front())) / total_block_size * 100;
size_t current_pos = std::get<0>(blocks.front());
if( current_pos > total_block_size )
total_block_size = current_pos;
bysize << std::fixed << std::setprecision(5) << double(current_pos) / total_block_size * 100;
bynum << std::fixed << std::setprecision(5) << double(i)*100/last_block_num;
ilog(
" [by size: ${size}% ${processed} of ${total}] [by num: ${num}% ${i} of ${last}]",
("size", bysize.str())
("processed", std::get<0>(blocks.front()))
("processed", current_pos)
("total", total_block_size)
("num", bynum.str())
("i", i)
Expand Down

0 comments on commit a6ed3c3

Please sign in to comment.