Skip to content

Commit

Permalink
Fix potential divide by zero in the progress dialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
mempko committed Feb 12, 2018
1 parent a8ef494 commit 13a42aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/qt/modaloverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate)
time_delta = current_millis - sample.first;

const int blocks_delta = count - sample.second;
if(blocks_delta >= 0) {
if(blocks_delta > 0) {

const int blocks_per_hour = static_cast<int>(blocks_delta/static_cast<double>(time_delta)*1000*3600);
remaining_msecs = (bestHeaderHeight - count) * time_delta / blocks_delta;
Expand Down

0 comments on commit 13a42aa

Please sign in to comment.