From 9de90bb749926a51aac15d5998bff3e12425675e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jan=C3=ADk?= Date: Thu, 10 Nov 2016 08:00:05 +0100 Subject: Do not shadow variables (gcc set) --- src/wallet/wallet.cpp | 24 ++++++++++++------------ src/wallet/walletdb.h | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/wallet') diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 638fca9917..5e1f9c445e 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -280,7 +280,7 @@ bool CWallet::LoadWatchOnly(const CScript &dest) bool CWallet::Unlock(const SecureString& strWalletPassphrase) { CCrypter crypter; - CKeyingMaterial vMasterKey; + CKeyingMaterial _vMasterKey; { LOCK(cs_wallet); @@ -288,9 +288,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; } } @@ -306,14 +306,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); @@ -330,7 +330,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) @@ -561,10 +561,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; @@ -587,7 +587,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; { @@ -605,7 +605,7 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) pwalletdbEncryption->WriteMasterKey(nMasterKeyMaxID, kMasterKey); } - if (!EncryptKeys(vMasterKey)) + if (!EncryptKeys(_vMasterKey)) { if (fFileBacked) { pwalletdbEncryption->TxnAbort(); diff --git a/src/wallet/walletdb.h b/src/wallet/walletdb.h index eb25ac613d..062438385c 100644 --- a/src/wallet/walletdb.h +++ b/src/wallet/walletdb.h @@ -116,7 +116,7 @@ public: class CWalletDB : public CDB { public: - CWalletDB(const std::string& strFilename, const char* pszMode = "r+", bool fFlushOnClose = true) : CDB(strFilename, pszMode, fFlushOnClose) + CWalletDB(const std::string& strFilename, const char* pszMode = "r+", bool _fFlushOnClose = true) : CDB(strFilename, pszMode, _fFlushOnClose) { } -- cgit v1.2.3