diff options
| author | Gavin Andresen <[email protected]> | 2013-05-02 12:43:07 -0400 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2013-05-02 12:43:07 -0400 |
| commit | 2f15e86a68aba56a8ea8e01e58b2fb7b71846b51 (patch) | |
| tree | 62a394f718d3f7a910579b43bfd33dda1f706cd3 /src/wallet.cpp | |
| parent | Merge pull request #2595 from sipa/noannloc (diff) | |
| download | discoin-2f15e86a68aba56a8ea8e01e58b2fb7b71846b51.tar.xz discoin-2f15e86a68aba56a8ea8e01e58b2fb7b71846b51.zip | |
Do not write to wallet during LoadWallet
When debugging another issue, I found a hang-during-startup race condition due to
LoadWallet calling SetMinVersion (via LoadCryptedKey).
Writing to the file that you're in the process of reading is a bad idea.
Diffstat (limited to 'src/wallet.cpp')
| -rw-r--r-- | src/wallet.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index c7eb4f74e..9658dab67 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -71,6 +71,11 @@ bool CWallet::AddCryptedKey(const CPubKey &vchPubKey, const vector<unsigned char return false; } +bool CWallet::LoadCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret) +{ + return CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret); +} + bool CWallet::AddCScript(const CScript& redeemScript) { if (!CCryptoKeyStore::AddCScript(redeemScript)) |