Remove always true cases in wallet/crypter.cpp encrypt and decrypt function #7643

pull JeremyRubin wants to merge 1 commits into bitcoin:master from JeremyRubin:master changing 1 files +4 −8
  1. JeremyRubin commented at 5:12 PM on March 4, 2016: contributor

    No description provided.

  2. Remove always true cases in wallet/crypter.cpp encrypt and decrypt function cca29a6727
  3. in src/wallet/crypter.cpp:None in cca29a6727
      63 | -    bool fOk = true;
      64 | -
      65 |      EVP_CIPHER_CTX_init(&ctx);
      66 | -    if (fOk) fOk = EVP_EncryptInit_ex(&ctx, EVP_aes_256_cbc(), NULL, chKey, chIV) != 0;
      67 | +
      68 | +    bool fOk = EVP_EncryptInit_ex(&ctx, EVP_aes_256_cbc(), NULL, chKey, chIV) != 0;
    


    jonasschnelli commented at 5:18 PM on March 4, 2016:

    IMO this results in the same (remove code) as above. The L66 EVP function only gets executed when fOk is true (which is always true at L66). fOk will then be set to true if the EVP function did not return 0.

    I think the current code works right.


    paveljanik commented at 7:49 PM on March 4, 2016:

    ... and looks ugly 8)

    ACK

  4. jonasschnelli commented at 7:54 PM on March 4, 2016: contributor

    Yes. This code is cleaner.

    utACK.

  5. theuni commented at 7:59 PM on March 4, 2016: member

    Change looks fine, but we're about to nuke it anyway with #5949. Would prefer to avoid the rebase.

  6. sipa commented at 3:42 AM on March 5, 2016: member

    No strong opinion about the code change, but agree with @theuni.

  7. MarcoFalke commented at 5:17 PM on March 5, 2016: member

    NACK, I like the previous code better because the "formatting" is uniform. Also, I am pretty sure the compiler will remove this case. Apart from that, agree with @theuni

  8. jonasschnelli added the label Wallet on Mar 6, 2016
  9. laanwj commented at 8:06 PM on March 6, 2016: member

    Yes, let's focus on getting #5949 merged instead.

  10. laanwj closed this on Mar 6, 2016

  11. 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-15 21:16 UTC

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