GUI: fix model overlay header sync #15091

pull jonasschnelli wants to merge 2 commits into bitcoin:master from jonasschnelli:2019/01/qt_fix_modal changing 3 files +10 −3
  1. jonasschnelli commented at 9:45 PM on January 3, 2019: contributor

    Update the block and header tip is constraint to have a minimal distance of 250ms between updates... which can lead to miss the last header update.

    The modal overlay then assumes we are still in header sync and the view get stuck in "syncing headers,..." (while it's actually syncing blocks).

    This removes the 250ms minimal delta for header updates as well as it fixes the correct display of how header updates should update the labels.

  2. jonasschnelli added the label GUI on Jan 3, 2019
  3. hebasto commented at 2:25 AM on January 4, 2019: member

    Concept ACK.

  4. in src/qt/modaloverlay.cpp:147 in b12dfd9436 outdated
     143 |      }
     144 |  }
     145 |  
     146 | +void ModalOverlay::UpdateHeaderSyncLabel() {
     147 | +    int est_headers_left = bestHeaderDate.secsTo(QDateTime::currentDateTime()) / Params().GetConsensus().nPowTargetSpacing;
     148 | +    ui->numberOfBlocksLeft->setText(tr("Unknown. Syncing Headers (%1, %2%)...").arg(bestHeaderHeight).arg(QString::number(100.0 / (bestHeaderHeight+est_headers_left)*bestHeaderHeight, 'f', 1)));
    


    hebasto commented at 2:53 AM on January 4, 2019:

    spaces around arithmetic operators?

  5. jonasschnelli force-pushed on Jan 4, 2019
  6. laanwj commented at 10:26 AM on January 4, 2019: member

    This removes the 250ms minimal delta for header updates as well as it fixes the correct display of how header updates should update the labels.

    The delta is there to prevent a flood of GUI update messages. I don't removing it is a good solution, we should take care that one update makes it per 250ms though.

  7. in src/qt/clientmodel.cpp:240 in a5061f6d6c outdated
     237 | @@ -238,7 +238,7 @@ static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, int heig
     238 |          clientmodel->cachedBestHeaderTime = blockTime;
     239 |      }
     240 |      // if we are in-sync, update the UI regardless of last update time
    


    MarcoFalke commented at 1:05 PM on January 4, 2019:

    Comment needs update?


    jonasschnelli commented at 6:52 PM on January 4, 2019:

    Fixed...

  8. jonasschnelli commented at 6:49 PM on January 4, 2019: contributor

    The delta is there to prevent a flood of GUI update messages. I don't removing it is a good solution, we should take care that one update makes it per 250ms though.

    I agree. This PR only removes the delay-update for header updates... which IMO should not result in GUI flood. AFAIK the GUI flood only gets problematic on chain tip updates.

  9. Qt: update header count regardless of update delay 7bb45e4b7a
  10. Qt: Fix update headers-count e8db6b8044
  11. jonasschnelli force-pushed on Jan 4, 2019
  12. hebasto commented at 5:57 PM on January 6, 2019: member

    tACK e8db6b8044424a6fbb4b0a80acffc8c7fbf6be8b (Linux Mint 19.2).

  13. jonasschnelli added this to the milestone 0.18.0 on Jan 31, 2019
  14. in src/qt/modaloverlay.cpp:147 in e8db6b8044
     143 |      }
     144 |  }
     145 |  
     146 | +void ModalOverlay::UpdateHeaderSyncLabel() {
     147 | +    int est_headers_left = bestHeaderDate.secsTo(QDateTime::currentDateTime()) / Params().GetConsensus().nPowTargetSpacing;
     148 | +    ui->numberOfBlocksLeft->setText(tr("Unknown. Syncing Headers (%1, %2%)...").arg(bestHeaderHeight).arg(QString::number(100.0 / (bestHeaderHeight + est_headers_left) * bestHeaderHeight, 'f', 1)));
    


    promag commented at 10:18 PM on January 31, 2019:

    nit, could use overloaded QString::arg http://doc.qt.io/qt-5/qstring.html#arg-8 instead of QString::number. Also, not really sure if it makes a difference but expression could be 100.0 * a / b.

  15. promag commented at 10:20 PM on January 31, 2019: member

    utACK e8db6b8.

  16. laanwj merged this on Feb 6, 2019
  17. laanwj closed this on Feb 6, 2019

  18. laanwj referenced this in commit 12a910c943 on Feb 6, 2019
  19. deadalnix referenced this in commit dbd6d0c8a1 on May 21, 2020
  20. deadalnix referenced this in commit f8f47c5324 on May 21, 2020
  21. Munkybooty referenced this in commit da1f61087b on Aug 23, 2021
  22. Munkybooty referenced this in commit 948b8c4eec on Aug 24, 2021
  23. Munkybooty referenced this in commit dc52d4d0f6 on Sep 1, 2021
  24. Munkybooty referenced this in commit a83293004b on Sep 5, 2021
  25. Munkybooty referenced this in commit 6e351cf9dc on Sep 7, 2021
  26. Munkybooty referenced this in commit b5b0d83918 on Sep 7, 2021
  27. Munkybooty referenced this in commit ca28a13113 on Sep 9, 2021
  28. Munkybooty referenced this in commit 03f2c9f8f0 on Sep 10, 2021
  29. DrahtBot locked this on Dec 16, 2021
Labels

Milestone
0.18.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me