Fix rescanblockchain rpc to properly report progress #13079

pull Empact wants to merge 1 commits into bitcoin:master from Empact:scan-for-wallet-stopblock-progress changing 1 files +18 −14
  1. Empact commented at 8:36 pm on April 25, 2018: member
    Previously it assumed tip in all cases. This also extracts a RescanVerificationProgress helper object whose role is to manage reporting, in order to simplify ScanForWalletTransactions - more lines in total, but much simpler to follow the core logic.
  2. in src/wallet/wallet.cpp:1728 in b5fe7a2737 outdated
    1723+
    1724+public:
    1725+    RescanVerificationProgress(const CWallet& wallet, const CBlockIndex* const stop_block)
    1726+        : m_wallet(wallet), m_time(GetTime()), m_stop_block(stop_block) {}
    1727+
    1728+    void Start(const CBlockIndex* const start_block)
    


    skeees commented at 8:54 pm on April 25, 2018:
    simpler to RAII this instead of a separate Constructor/Start/AnnounceStart methods?

    Empact commented at 9:03 pm on April 25, 2018:
    The main reason I kept this separate is that GuessVerificationProgress needs cs_main held, and I wanted to minimize the amount of code in the lock-block.
  3. fanquake added the label Wallet on Apr 25, 2018
  4. Empact force-pushed on Apr 30, 2018
  5. Empact renamed this:
    Fix ScanForWalletTransactions to report progress correctly when a pindexStop is supplied
    Fix rescanblockchain rpc to property report progress
    on Apr 30, 2018
  6. Empact commented at 7:07 am on April 30, 2018: member
    Removed the refactoring for easier review.
  7. jonasschnelli commented at 12:05 pm on April 30, 2018: contributor
    Makes sense. Reporting progress for partial rescans based on the given range seems to be more logical. utACK 409db40b6f56748a5b1713a0bc117a8365d9f3ef
  8. in src/wallet/wallet.cpp:1742 in 409db40b6f outdated
    1741@@ -1742,9 +1742,13 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlock
    1742         double dProgressTip;
    


    MarcoFalke commented at 12:48 pm on April 30, 2018:
    should probably be called progress_end
  9. in src/wallet/wallet.cpp:1747 in 409db40b6f outdated
    1741@@ -1742,9 +1742,13 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlock
    1742         double dProgressTip;
    1743         {
    1744             LOCK(cs_main);
    1745-            tip = chainActive.Tip();
    1746             dProgressStart = GuessVerificationProgress(chainParams.TxData(), pindex);
    1747-            dProgressTip = GuessVerificationProgress(chainParams.TxData(), tip);
    1748+            if (pindexStop == nullptr) {
    1749+              tip = chainActive.Tip()
    


    MarcoFalke commented at 12:49 pm on April 30, 2018:
    missing semicolon, also wrong indentation.
  10. MarcoFalke commented at 12:49 pm on April 30, 2018: member
    utACK 409db40
  11. laanwj commented at 12:59 pm on April 30, 2018: member

    From travis:

    0wallet/wallet.cpp: In member function CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex*, CBlockIndex*, const WalletRescanReserver&, bool):
    1wallet/wallet.cpp:1748:15: error: expected ; before dProgressTip
    2               dProgressTip = GuessVerificationProgress(chainParams.TxData(), tip);
    3               ^
    
  12. Empact force-pushed on Apr 30, 2018
  13. Empact commented at 2:38 pm on April 30, 2018: member
    Added semicolon, renamed progress vars to progress_*, and clang-formatted.
  14. Empact renamed this:
    Fix rescanblockchain rpc to property report progress
    Fix rescanblockchain rpc to properly report progress
    on Apr 30, 2018
  15. Fix rescanblockchain rpc to property report progress
    CWallet::ScanForWalletTransactions did not previously take into account
    pindexStop when calculating progress.
    
    Renamed progress vars to progress_*.
    
    rescanblockchain is the only rpc that uses this parameter.
    16be13345e
  16. Empact force-pushed on May 3, 2018
  17. Empact commented at 5:20 pm on May 3, 2018: member
    Rebased
  18. TheBlueMatt commented at 7:16 pm on May 6, 2018: member
    utACK 16be13345e4f9ab9186570c83828db94e3a3d607
  19. MarcoFalke commented at 7:34 pm on May 6, 2018: member
    utACK 16be13345e4f9ab9186570c83828db94e3a3d607
  20. jonasschnelli commented at 1:02 pm on May 7, 2018: contributor
    Tested ACK 16be13345e4f9ab9186570c83828db94e3a3d607
  21. jonasschnelli merged this on May 7, 2018
  22. jonasschnelli closed this on May 7, 2018

  23. jonasschnelli referenced this in commit 5778d44aa8 on May 7, 2018
  24. promag commented at 1:16 pm on May 7, 2018: member
    utACK 16be133.
  25. Empact deleted the branch on May 7, 2018
  26. jasonbcox referenced this in commit d559f01c77 on Sep 27, 2019
  27. jonspock referenced this in commit 9a37ea937f on Dec 24, 2019
  28. jonspock referenced this in commit 6c891d00ca on Dec 26, 2019
  29. jonspock referenced this in commit 94a72eabc1 on Dec 27, 2019
  30. PastaPastaPasta referenced this in commit 718f2d84df on Jun 17, 2020
  31. PastaPastaPasta referenced this in commit 49d0859fb6 on Jun 27, 2020
  32. PastaPastaPasta referenced this in commit c0a47bdfcb on Jun 28, 2020
  33. karra75 commented at 9:34 am on December 17, 2020: none
    U
  34. karra75 commented at 2:01 pm on December 17, 2020: none
    Sorce
  35. DrahtBot locked this on Feb 15, 2022

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: 2024-11-17 06:12 UTC

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