bugfix: initialize IsHDEnabled correctly. #407

pull Saibato wants to merge 1 commits into bitcoin-core:master from Saibato:icon_update changing 1 files +6 −2
  1. Saibato commented at 1:35 pm on August 23, 2021: contributor

    the result of IsHDEnabled() was initialized with true.

    But in case of no keys or a blank hd wallet the iterator would be skipped and not set to false. What had resulted in a wrong return and subsequent false hd and watch only icon display in gui when reloading a wallet after closing.

    .. PR has move to main repro https://github.com/bitcoin/bitcoin/pull/22781

  2. Saibato force-pushed on Aug 23, 2021
  3. Saibato force-pushed on Aug 23, 2021
  4. bugfix: initialize the bool value corresponding to the actual wallet key size
    the result of the call was initialized with true.
    But in case of no keys, the iterator would be skipped
    and not set to false.
    What had resulted in a wrong return and subsequent false icon display
    in gui.
    7330d8c01a
  5. Saibato force-pushed on Aug 23, 2021
  6. in src/wallet/wallet.cpp:1375 in 7330d8c01a
    1372+            result = true;
    1373+        } else {
    1374+            return false;
    1375+        }
    1376     }
    1377     return result;
    


    MarcoFalke commented at 3:03 pm on August 23, 2021:

    easier would be:

    0for ...
    1  if ! enabled: return false;
    2return true;
    

    Saibato commented at 4:14 pm on August 23, 2021:
    not quite, since we need to return false of the init value in case the for loop is never entered. afaics.
  7. MarcoFalke commented at 3:04 pm on August 23, 2021: contributor
    This is the wrong repo. To modify wallet code, you will need to submit to the main repo.
  8. MarcoFalke closed this on Aug 23, 2021

  9. Saibato commented at 4:04 pm on August 23, 2021: contributor

    This is the wrong repo. To modify wallet code, you will need to submit to the main repo.

    fwics it effects only the gui, but you obviously correct, i will file it too under main,

  10. bitcoin-core locked this on Aug 23, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-26 23:20 UTC

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