Make CCryptoKeyStore::Unlock check all keys (but only once) #4670

pull TheBlueMatt wants to merge 2 commits into bitcoin:master from TheBlueMatt:keystore_loop changing 2 files +29 −5
  1. TheBlueMatt commented at 1:50 AM on August 10, 2014: member

    Extends #4011 by three lines. I know we have multiple wallet support in theory, but until it actually appears, a static should be fine.

  2. gmaxwell commented at 1:53 AM on August 10, 2014: contributor

    Sounds fine to me.

  3. jgarzik commented at 12:08 PM on August 10, 2014: contributor

    @TheBlueMatt RE multi-wallet theory vs reality, that probably deserves a comment, since we are adding technical debt.

  4. sipa commented at 12:20 PM on August 10, 2014: member

    Better is better, but it doesn't seem hard to me to make the unlock method take a bool thoroughCheck or something, and remember in the wallet whether a thorough check succeeded in the past, and then don't redo it...

  5. Make CCryptoKeyStore::Unlock check all keys.
    CCryptoKeyStore::Unlock has a loop to attempt decrypting each key which
     only executes once, likely due to a simple mistake when the code was
     originally written.
    
    This patch fixes the behavior by making it check all keys. It also adds
     a fatal assertion in the case some decrypt but some do not, since that
     indicates that the wallet is in some kind of really bad state.
    
    This may make unlocking noticeably slower on wallets with many keys.
    1e21c17d20
  6. Dont run full check every time we decrypt wallet. a35b55b522
  7. TheBlueMatt commented at 1:36 AM on August 11, 2014: member

    @sipa: Like this?

  8. BitcoinPullTester commented at 1:57 AM on August 11, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4670_a35b55b522da8eeaed895f0ed43ba595fc083498/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  9. laanwj commented at 6:58 AM on August 11, 2014: member

    Untested ACK

  10. sipa commented at 9:45 AM on August 11, 2014: member

    Untested ACK.

  11. laanwj added the label Wallet on Aug 11, 2014
  12. gmaxwell commented at 12:51 PM on August 14, 2014: contributor

    Tested ACK.

  13. laanwj merged this on Aug 19, 2014
  14. laanwj closed this on Aug 19, 2014

  15. laanwj referenced this in commit dd2819701a on Aug 19, 2014
  16. MarcoFalke locked this on Sep 8, 2021

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-18 21:15 UTC

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