Use DB Transactions when encrypting wallet.

This speeds up the encryption process significantly.
This commit is contained in:
Matt Corallo
2011-07-08 15:08:27 +02:00
parent 0efda1a79e
commit 96f34cd5c4
2 changed files with 29 additions and 6 deletions

View File

@@ -18,6 +18,8 @@ private:
bool SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfTheirs, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const;
bool SelectCoins(int64 nTargetValue, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const;
CWalletDB *pwalletdbEncryption;
CCriticalSection cs_pwalletdbEncryption;
public:
bool fFileBacked;
@@ -34,12 +36,14 @@ public:
{
fFileBacked = false;
nMasterKeyMaxID = 0;
pwalletdbEncryption = NULL;
}
CWallet(std::string strWalletFileIn)
{
strWalletFile = strWalletFileIn;
fFileBacked = true;
nMasterKeyMaxID = 0;
pwalletdbEncryption = NULL;
}
mutable CCriticalSection cs_mapWallet;