Fix crashes when a wallet is locked and GetReservedKey() is called #409

pull TheBlueMatt wants to merge 1 commits into bitcoin:master from TheBlueMatt:master changing 1 files +4 −1
  1. TheBlueMatt commented at 1:12 AM on July 14, 2011: member

    No description provided.

  2. Fix crashes when a wallet is locked and GetReservedKey() is called 0d7b28e52e
  3. jgarzik referenced this in commit 60d2f8662c on Jul 14, 2011
  4. jgarzik merged this on Jul 14, 2011
  5. jgarzik closed this on Jul 14, 2011

  6. in src/wallet.cpp:None in 0d7b28e52e
    1319 | @@ -1320,7 +1320,10 @@ vector<unsigned char> CReserveKey::GetReservedKey()
    1320 |      {
    1321 |          CKeyPool keypool;
    1322 |          pwallet->ReserveKeyFromKeyPool(nIndex, keypool);
    1323 | -        vchPubKey = keypool.vchPubKey;
    1324 | +        if (nIndex != -1)
    1325 | +            vchPubKey = keypool.vchPubKey;
    1326 | +        else
    1327 | +            vchPubKey = vchDefaultKey;
    


    gavinandresen commented at 1:25 AM on July 14, 2011:

    Using the wallet default key instead of a new keypool key should at least generate a message in debug.log-- I think a printf inside the else is needed.

  7. zathras-crypto referenced this in commit 9e860fa185 on Aug 28, 2016
  8. classesjack referenced this in commit 2a7afc91f2 on Jan 2, 2018
  9. lateminer referenced this in commit 484dc19f81 on Feb 23, 2019
  10. lateminer referenced this in commit 5b23625cc7 on Oct 16, 2019
  11. DrahtBot 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-24 15:16 UTC

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