diff options
Diffstat (limited to 'src/db.cpp')
-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 0e5522298b..b67e2a6452 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -848,12 +848,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); |