diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2011-06-07 11:38:35 -0700 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2011-06-07 11:38:35 -0700 |
commit | 60152827e35102cd6faf450ba5400ed4364c2e62 (patch) | |
tree | 4efad3185c35ffec94b1f33839bb7bade3c82b40 | |
parent | 04bc3f0a632808d6d6df3e0cf4dbe39915fb3eda (diff) | |
parent | ca81b168d9ba61d918f029c0d8bf520ef2da1d3d (diff) |
Merge pull request #293 from tcatm/keypool-fix
create keypool in LoadWallet()
-rw-r--r-- | src/db.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/db.cpp b/src/db.cpp index 52c0f5b4c3..c2c239db2f 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -845,12 +845,11 @@ bool LoadWallet(bool& fFirstRunRet) { // Create new keyUser and set as default key RandAddSeedPerfmon(); - keyUser.MakeNewKey(); - if (!AddKey(keyUser)) - return false; - if (!SetAddressBookName(PubKeyToAddress(keyUser.GetPubKey()), "")) - return false; - CWalletDB().WriteDefaultKey(keyUser.GetPubKey()); + + CWalletDB walletdb; + vchDefaultKey = GetKeyFromKeyPool(); + walletdb.WriteDefaultKey(vchDefaultKey); + walletdb.WriteName(PubKeyToAddress(vchDefaultKey), ""); } CreateThread(ThreadFlushWalletDB, NULL); |