|
|
@ -1280,20 +1280,23 @@ bool CWallet::GetKeyFromPool(vector<unsigned char>& result, bool fAllowReuse) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int64 nIndex = 0; |
|
|
|
int64 nIndex = 0; |
|
|
|
CKeyPool keypool; |
|
|
|
CKeyPool keypool; |
|
|
|
ReserveKeyFromKeyPool(nIndex, keypool); |
|
|
|
CRITICAL_BLOCK(cs_wallet) |
|
|
|
if (nIndex == -1) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (fAllowReuse && !vchDefaultKey.empty()) |
|
|
|
ReserveKeyFromKeyPool(nIndex, keypool); |
|
|
|
|
|
|
|
if (nIndex == -1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
result = vchDefaultKey; |
|
|
|
if (fAllowReuse && !vchDefaultKey.empty()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
result = vchDefaultKey; |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (IsLocked()) return false; |
|
|
|
|
|
|
|
result = GenerateNewKey(); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
if (IsLocked()) return false; |
|
|
|
KeepKey(nIndex); |
|
|
|
result = GenerateNewKey(); |
|
|
|
result = keypool.vchPubKey; |
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
KeepKey(nIndex); |
|
|
|
|
|
|
|
result = keypool.vchPubKey; |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|