mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 18:53:23 -03:00
Fix crashes when a wallet is locked and GetReservedKey() is called
This commit is contained in:
parent
9cd22ab862
commit
0d7b28e52e
1 changed files with 4 additions and 1 deletions
|
@ -1320,7 +1320,10 @@ vector<unsigned char> CReserveKey::GetReservedKey()
|
||||||
{
|
{
|
||||||
CKeyPool keypool;
|
CKeyPool keypool;
|
||||||
pwallet->ReserveKeyFromKeyPool(nIndex, keypool);
|
pwallet->ReserveKeyFromKeyPool(nIndex, keypool);
|
||||||
|
if (nIndex != -1)
|
||||||
vchPubKey = keypool.vchPubKey;
|
vchPubKey = keypool.vchPubKey;
|
||||||
|
else
|
||||||
|
vchPubKey = vchDefaultKey;
|
||||||
}
|
}
|
||||||
assert(!vchPubKey.empty());
|
assert(!vchPubKey.empty());
|
||||||
return vchPubKey;
|
return vchPubKey;
|
||||||
|
|
Loading…
Add table
Reference in a new issue