aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@exmulti.com>2011-07-13 18:22:19 -0700
committerJeff Garzik <jgarzik@exmulti.com>2011-07-13 18:22:19 -0700
commit60d2f8662c48d3456e41b8e2b118c20e2ea43ace (patch)
treee5f66dbc4fa2f57fbd468cf5aca50fd4b32aafd3
parent9cd22ab86296ae7039132423c7f9847bdc19a644 (diff)
parent0d7b28e52ea5302ce6aa17399a0027e33168c372 (diff)
Merge pull request #409 from TheBlueMatt/master
Fix crashes when a wallet is locked and GetReservedKey() is called
-rw-r--r--src/wallet.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index f275853528..5f7cddf57e 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;