mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 18:53:23 -03:00
obtain cs_wallet mutex to protect vchDefaultKey
This commit is contained in:
parent
123e5bd998
commit
ed02c95d50
1 changed files with 12 additions and 9 deletions
|
@ -1280,6 +1280,8 @@ bool CWallet::GetKeyFromPool(vector<unsigned char>& result, bool fAllowReuse)
|
|||
{
|
||||
int64 nIndex = 0;
|
||||
CKeyPool keypool;
|
||||
CRITICAL_BLOCK(cs_wallet)
|
||||
{
|
||||
ReserveKeyFromKeyPool(nIndex, keypool);
|
||||
if (nIndex == -1)
|
||||
{
|
||||
|
@ -1294,6 +1296,7 @@ bool CWallet::GetKeyFromPool(vector<unsigned char>& result, bool fAllowReuse)
|
|||
}
|
||||
KeepKey(nIndex);
|
||||
result = keypool.vchPubKey;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue