@@ -628,8 +628,8 @@ bool CWallet::ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase,
628628 crypter.SetKeyFromPassphrase (strNewWalletPassphrase, pMasterKey.second .vchSalt , pMasterKey.second .nDeriveIterations , pMasterKey.second .nDerivationMethod );
629629 pMasterKey.second .nDeriveIterations = (pMasterKey.second .nDeriveIterations + static_cast <unsigned int >(pMasterKey.second .nDeriveIterations * target / (SteadyClock::now () - start))) / 2 ;
630630
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 ;
633633
634634 WalletLogPrintf (" Wallet passphrase changed to an nDeriveIterations of %i\n " , pMasterKey.second .nDeriveIterations );
635635
@@ -825,15 +825,15 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
825825 CCrypter crypter;
826826 constexpr MillisecondsDouble target{100 };
827827 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));
830830
831831 start = SteadyClock::now ();
832832 crypter.SetKeyFromPassphrase (strWalletPassphrase, kMasterKey .vchSalt , kMasterKey .nDeriveIterations , kMasterKey .nDerivationMethod );
833833 kMasterKey .nDeriveIterations = (kMasterKey .nDeriveIterations + static_cast <unsigned int >(kMasterKey .nDeriveIterations * target / (SteadyClock::now () - start))) / 2 ;
834834
835- if (kMasterKey .nDeriveIterations < 25000 )
836- kMasterKey .nDeriveIterations = 25000 ;
835+ if (kMasterKey .nDeriveIterations < CMasterKey::DEFAULT_DERIVE_ITERATIONS )
836+ kMasterKey .nDeriveIterations = CMasterKey::DEFAULT_DERIVE_ITERATIONS ;
837837
838838 WalletLogPrintf (" Encrypting Wallet with an nDeriveIterations of %i\n " , kMasterKey .nDeriveIterations );
839839
0 commit comments