Skip to content

Commit

Permalink
Merge pull request bitcoin#409 from TheBlueMatt/master
Browse files Browse the repository at this point in the history
Fix crashes when a wallet is locked and GetReservedKey() is called
  • Loading branch information
Jeff Garzik committed Jul 14, 2011
2 parents 9cd22ab + 0d7b28e commit 60d2f86
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 60d2f86

Please sign in to comment.