Add -walletupdates: resolves #12632 #12792

pull skeees wants to merge 3 commits into bitcoin:master from skeees:wallet-updates changing 3 files +69 −6
  1. skeees commented at 6:03 PM on March 26, 2018: contributor

    When false, wallet does not rescan the chain from its last known best block on startup or subscribe to CValidationInterface notifications. Useful for wallet maintenance type activities where one desires to avoid the overhead of rescan on startup.

    Fixes #12632.

  2. Add -disablewalletupdates: resolves #12632
        When true, wallet does not rescan the chain from its last known
        best block on startup or subscribe to CValidationInterface
        notifications.  Useful for wallet maintenance type activities where one desires to
        avoid the overhead of rescan on startup.
    2ed16336ea
  3. in src/wallet/init.cpp:34 in 2ed16336ea outdated
      30 | @@ -31,6 +31,7 @@ std::string GetWalletHelpString(bool showDebug)
      31 |      strUsage += HelpMessageOpt("-paytxfee=<amt>", strprintf(_("Fee (in %s/kB) to add to transactions you send (default: %s)"),
      32 |                                                              CURRENCY_UNIT, FormatMoney(payTxFee.GetFeePerK())));
      33 |      strUsage += HelpMessageOpt("-rescan", _("Rescan the block chain for missing wallet transactions on startup"));
      34 | +    strUsage += HelpMessageOpt("-disablewalletupdates", _("Do not update the wallet with any new blocks that have been seen since last load"));
    


    laanwj commented at 7:23 PM on March 26, 2018:

    For consistency, we try to make the meaning positive for new options, instead of reversing w/ disable in front. E.g. make this option -walletupdates and default to 1, so that the usual -nowalletupdates or -walletupdates=0 can be used to not do wallet updates.

    Also: is this uncommon enough to make it an untranslated showDebug only option?

  4. in src/wallet/wallet.cpp:4052 in 2ed16336ea outdated
    4051 | -            pindexRescan = FindForkInGlobalIndex(chainActive, locator);
    4052 | +        if(subscribe_to_chain_updates) {
    4053 | +            CWalletDB walletdb(*walletInstance->dbw);
    4054 | +            CBlockLocator locator;
    4055 | +            if (walletdb.ReadBestBlock(locator))
    4056 | +                pindexRescan = FindForkInGlobalIndex(chainActive, locator);
    


    MarcoFalke commented at 7:25 PM on March 26, 2018:

    Might want to add braces {} around that to adhere to the coding style for new code and then install clang-format and run the https://github.com/bitcoin/bitcoin/tree/master/contrib/devtools#clang-format-diffpy script to preempt whitespace nitpicking.

  5. laanwj commented at 7:32 PM on March 26, 2018: member

    Needs a test in test/functional? (possibly as part of another wallet test)

  6. laanwj added the label Wallet on Mar 26, 2018
  7. Address review comments c1f01d7188
  8. skeees commented at 7:54 PM on March 26, 2018: contributor

    Will add functional test and update

  9. skeees renamed this:
    Add -disablewalletupdates: resolves #12632
    Add -walletupdates: resolves #12632
    on Mar 26, 2018
  10. Add test for -[no]walletupdates afe7c3852c
  11. skeees commented at 8:46 PM on March 26, 2018: contributor

    Test added - can rebase and squash into one commit if there are no further comments / fixes

  12. promag commented at 9:25 PM on March 26, 2018: member

    Fixes #12632.

  13. skeees commented at 4:00 PM on May 4, 2018: contributor

    @jnewbery @promag - with the ongoing efforts to do dynamic wallet (un)loading and to move wallet maintenance into a wallet-tool - is this still relevant/necessary? if not will close

  14. promag commented at 9:33 PM on May 4, 2018: member

    Not sure @skeees, this is orthogonal to dynamic wallet (un)loading.

    BTW, how about a different approach: load the wallet in "read only" mode?

  15. MarcoFalke added the label Needs rebase on Jun 6, 2018
  16. luke-jr commented at 5:16 PM on June 12, 2018: member

    Option name seems too much like -upgradewallet

    Maybe -walletsync instead?

  17. DrahtBot added the label Up for grabs on Oct 28, 2018
  18. DrahtBot commented at 1:48 PM on October 28, 2018: member

    <!--5fd3d806e98f4a0ca80977bb178665a0-->There hasn't been much activity lately and the patch still needs rebase, so I am closing this for now. Please let me know when you want to continue working on this, so the pull request can be re-opened.

  19. DrahtBot closed this on Oct 28, 2018

  20. laanwj removed the label Needs rebase on Oct 24, 2019
  21. DrahtBot locked this on Dec 16, 2021
  22. MarcoFalke removed the label Up for grabs on Mar 22, 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: 2026-04-21 15:15 UTC

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