From ca81b168d9ba61d918f029c0d8bf520ef2da1d3d Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Fri, 3 Jun 2011 18:03:12 +0200 Subject: [PATCH] create keypool in LoadWallet() --- src/db.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/db.cpp b/src/db.cpp index 52c0f5b4..c2c239db 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);