-
Notifications
You must be signed in to change notification settings - Fork 36.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Wallet: Cache CWalletDB pointer in CWallet to improve performance #6966
Conversation
Concept ACK. |
@jonasschnelli this is very very much a WIP :) |
Right. I almost oversaw the WIP tag. |
Have you measured the performance improvements? Concept ACK but I'm not convinced that this will not result in less robustness with regard to database flushes (see my other comment). This is essential, even more so for the wallet than for the utxo database. |
@@ -274,7 +274,7 @@ bool CWallet::ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, | |||
return false; | |||
if (!crypter.Encrypt(vMasterKey, pMasterKey.second.vchCryptedKey)) | |||
return false; | |||
CWalletDB(strWalletFile).WriteMasterKey(pMasterKey.first, pMasterKey.second); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a reason we create CWalletDB objects every time per operation. From what I remember this assures that the transactions are closed/flushed properly.
@laanwj I have not specifically but "much much much faster" is how i would describe it |
OK. That's good to hear. Just need to verify that it doesn't come at the expense of robustness, then. |
@laanwj CDB::~CDB simply calls CDB::Close which basically just calls Flush So it's simply a matter of ensuring that we call Flush properly |
The easier thing to do is to simple change the default for fFlushOnClose to false, but that doesn't allow for optimizing batch operations such as keypoolrefill (which was actually my original motivation for this change). |
Will do this more incrementally. |
No description provided.