mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-17 19:18:00 +02:00
Merge #8808: Do not shadow variables (gcc set)
ad1ae7aCheck and enable -Wshadow by default. (Pavel Janík)9de90bbDo not shadow variables (gcc set) (Pavel Janík) Tree-SHA512: 9517feb423dc8ddd63896016b25324673bfbe0bffa97f22996f59d7a3fcbdc2ebf2e43ac02bc067546f54e293e9b2f2514be145f867321e9031f895c063d9fb8
This commit is contained in:
@@ -296,7 +296,7 @@ bool CWallet::LoadWatchOnly(const CScript &dest)
|
||||
bool CWallet::Unlock(const SecureString& strWalletPassphrase)
|
||||
{
|
||||
CCrypter crypter;
|
||||
CKeyingMaterial vMasterKey;
|
||||
CKeyingMaterial _vMasterKey;
|
||||
|
||||
{
|
||||
LOCK(cs_wallet);
|
||||
@@ -304,9 +304,9 @@ bool CWallet::Unlock(const SecureString& strWalletPassphrase)
|
||||
{
|
||||
if(!crypter.SetKeyFromPassphrase(strWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))
|
||||
return false;
|
||||
if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, vMasterKey))
|
||||
if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, _vMasterKey))
|
||||
continue; // try another master key
|
||||
if (CCryptoKeyStore::Unlock(vMasterKey))
|
||||
if (CCryptoKeyStore::Unlock(_vMasterKey))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -322,14 +322,14 @@ bool CWallet::ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase,
|
||||
Lock();
|
||||
|
||||
CCrypter crypter;
|
||||
CKeyingMaterial vMasterKey;
|
||||
CKeyingMaterial _vMasterKey;
|
||||
BOOST_FOREACH(MasterKeyMap::value_type& pMasterKey, mapMasterKeys)
|
||||
{
|
||||
if(!crypter.SetKeyFromPassphrase(strOldWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))
|
||||
return false;
|
||||
if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, vMasterKey))
|
||||
if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, _vMasterKey))
|
||||
return false;
|
||||
if (CCryptoKeyStore::Unlock(vMasterKey))
|
||||
if (CCryptoKeyStore::Unlock(_vMasterKey))
|
||||
{
|
||||
int64_t nStartTime = GetTimeMillis();
|
||||
crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod);
|
||||
@@ -346,7 +346,7 @@ bool CWallet::ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase,
|
||||
|
||||
if (!crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))
|
||||
return false;
|
||||
if (!crypter.Encrypt(vMasterKey, pMasterKey.second.vchCryptedKey))
|
||||
if (!crypter.Encrypt(_vMasterKey, pMasterKey.second.vchCryptedKey))
|
||||
return false;
|
||||
CWalletDB(strWalletFile).WriteMasterKey(pMasterKey.first, pMasterKey.second);
|
||||
if (fWasLocked)
|
||||
@@ -584,10 +584,10 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
|
||||
if (IsCrypted())
|
||||
return false;
|
||||
|
||||
CKeyingMaterial vMasterKey;
|
||||
CKeyingMaterial _vMasterKey;
|
||||
|
||||
vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE);
|
||||
GetStrongRandBytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE);
|
||||
_vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE);
|
||||
GetStrongRandBytes(&_vMasterKey[0], WALLET_CRYPTO_KEY_SIZE);
|
||||
|
||||
CMasterKey kMasterKey;
|
||||
|
||||
@@ -610,7 +610,7 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
|
||||
|
||||
if (!crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, kMasterKey.nDeriveIterations, kMasterKey.nDerivationMethod))
|
||||
return false;
|
||||
if (!crypter.Encrypt(vMasterKey, kMasterKey.vchCryptedKey))
|
||||
if (!crypter.Encrypt(_vMasterKey, kMasterKey.vchCryptedKey))
|
||||
return false;
|
||||
|
||||
{
|
||||
@@ -628,7 +628,7 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
|
||||
pwalletdbEncryption->WriteMasterKey(nMasterKeyMaxID, kMasterKey);
|
||||
}
|
||||
|
||||
if (!EncryptKeys(vMasterKey))
|
||||
if (!EncryptKeys(_vMasterKey))
|
||||
{
|
||||
if (fFileBacked) {
|
||||
pwalletdbEncryption->TxnAbort();
|
||||
|
||||
Reference in New Issue
Block a user