diff options
| author | Matt Corallo <[email protected]> | 2011-07-14 03:11:40 +0200 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2011-07-14 03:11:40 +0200 |
| commit | 0d7b28e52ea5302ce6aa17399a0027e33168c372 (patch) | |
| tree | e5f66dbc4fa2f57fbd468cf5aca50fd4b32aafd3 /src/wallet.cpp | |
| parent | Merge pull request #406 from muggenhor/warning-fixes (diff) | |
| download | discoin-0d7b28e52ea5302ce6aa17399a0027e33168c372.tar.xz discoin-0d7b28e52ea5302ce6aa17399a0027e33168c372.zip | |
Fix crashes when a wallet is locked and GetReservedKey() is called
Diffstat (limited to 'src/wallet.cpp')
| -rw-r--r-- | src/wallet.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index f27585352..5f7cddf57 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1320,7 +1320,10 @@ vector<unsigned char> CReserveKey::GetReservedKey() { CKeyPool keypool; pwallet->ReserveKeyFromKeyPool(nIndex, keypool); - vchPubKey = keypool.vchPubKey; + if (nIndex != -1) + vchPubKey = keypool.vchPubKey; + else + vchPubKey = vchDefaultKey; } assert(!vchPubKey.empty()); return vchPubKey; |