mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-05-17 23:56:39 +00:00
refactor: Use only one temporary buffer in CreateObfuscateKey
This commit is contained in:
parent
fa05dddc42
commit
face961109
@ -220,10 +220,9 @@ const unsigned int CDBWrapper::OBFUSCATE_KEY_NUM_BYTES = 8;
|
|||||||
*/
|
*/
|
||||||
std::vector<unsigned char> CDBWrapper::CreateObfuscateKey() const
|
std::vector<unsigned char> CDBWrapper::CreateObfuscateKey() const
|
||||||
{
|
{
|
||||||
unsigned char buff[OBFUSCATE_KEY_NUM_BYTES];
|
std::vector<uint8_t> ret(OBFUSCATE_KEY_NUM_BYTES);
|
||||||
GetRandBytes(buff, OBFUSCATE_KEY_NUM_BYTES);
|
GetRandBytes(ret.data(), OBFUSCATE_KEY_NUM_BYTES);
|
||||||
return std::vector<unsigned char>(&buff[0], &buff[OBFUSCATE_KEY_NUM_BYTES]);
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CDBWrapper::IsEmpty()
|
bool CDBWrapper::IsEmpty()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user