Merge pull request #293 from tcatm/keypool-fix

create keypool in LoadWallet()
This commit is contained in:
Gavin Andresen 2011-06-07 11:38:35 -07:00
commit 60152827e3

View File

@ -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);