@@ -628,8 +628,8 @@ bool CWallet::ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase,
628
628
crypter.SetKeyFromPassphrase (strNewWalletPassphrase, pMasterKey.second .vchSalt , pMasterKey.second .nDeriveIterations , pMasterKey.second .nDerivationMethod );
629
629
pMasterKey.second .nDeriveIterations = (pMasterKey.second .nDeriveIterations + static_cast <unsigned int >(pMasterKey.second .nDeriveIterations * target / (SteadyClock::now () - start))) / 2 ;
630
630
631
- if (pMasterKey.second .nDeriveIterations < 25000 )
632
- pMasterKey.second .nDeriveIterations = 25000 ;
631
+ if (pMasterKey.second .nDeriveIterations < CMasterKey::DEFAULT_DERIVE_ITERATIONS )
632
+ pMasterKey.second .nDeriveIterations = CMasterKey::DEFAULT_DERIVE_ITERATIONS ;
633
633
634
634
WalletLogPrintf (" Wallet passphrase changed to an nDeriveIterations of %i\n " , pMasterKey.second .nDeriveIterations );
635
635
@@ -825,15 +825,15 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
825
825
CCrypter crypter;
826
826
constexpr MillisecondsDouble target{100 };
827
827
auto start{SteadyClock::now ()};
828
- crypter.SetKeyFromPassphrase (strWalletPassphrase, kMasterKey .vchSalt , 25000 , kMasterKey .nDerivationMethod );
829
- kMasterKey .nDeriveIterations = static_cast <unsigned int >(25000 * target / (SteadyClock::now () - start));
828
+ crypter.SetKeyFromPassphrase (strWalletPassphrase, kMasterKey .vchSalt , CMasterKey::DEFAULT_DERIVE_ITERATIONS , kMasterKey .nDerivationMethod );
829
+ kMasterKey .nDeriveIterations = static_cast <unsigned int >(CMasterKey::DEFAULT_DERIVE_ITERATIONS * target / (SteadyClock::now () - start));
830
830
831
831
start = SteadyClock::now ();
832
832
crypter.SetKeyFromPassphrase (strWalletPassphrase, kMasterKey .vchSalt , kMasterKey .nDeriveIterations , kMasterKey .nDerivationMethod );
833
833
kMasterKey .nDeriveIterations = (kMasterKey .nDeriveIterations + static_cast <unsigned int >(kMasterKey .nDeriveIterations * target / (SteadyClock::now () - start))) / 2 ;
834
834
835
- if (kMasterKey .nDeriveIterations < 25000 )
836
- kMasterKey .nDeriveIterations = 25000 ;
835
+ if (kMasterKey .nDeriveIterations < CMasterKey::DEFAULT_DERIVE_ITERATIONS )
836
+ kMasterKey .nDeriveIterations = CMasterKey::DEFAULT_DERIVE_ITERATIONS ;
837
837
838
838
WalletLogPrintf (" Encrypting Wallet with an nDeriveIterations of %i\n " , kMasterKey .nDeriveIterations );
839
839
0 commit comments