Skip to content

Commit

Permalink
Merge pull request #2246 from bitshares/replay-percent-fix
Browse files Browse the repository at this point in the history
Fix replay percent calculation
  • Loading branch information
abitmore committed Aug 24, 2020
2 parents 0b76c73 + a6ed3c3 commit d3e05d1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 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;
bynum << std::fixed << std::setprecision(5) << double(i*100)/last_block_num;
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 d3e05d1

Please sign in to comment.