Browse Source

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

miguelfreitas
Matt Corallo 14 years ago
parent
commit
0d7b28e52e
  1. 5
      src/wallet.cpp

5
src/wallet.cpp

@ -1320,7 +1320,10 @@ vector<unsigned char> CReserveKey::GetReservedKey()
{ {
CKeyPool keypool; CKeyPool keypool;
pwallet->ReserveKeyFromKeyPool(nIndex, keypool); pwallet->ReserveKeyFromKeyPool(nIndex, keypool);
vchPubKey = keypool.vchPubKey; if (nIndex != -1)
vchPubKey = keypool.vchPubKey;
else
vchPubKey = vchDefaultKey;
} }
assert(!vchPubKey.empty()); assert(!vchPubKey.empty());
return vchPubKey; return vchPubKey;

Loading…
Cancel
Save