|
|
@ -962,21 +962,15 @@ bool CWallet::LoadWallet(bool& fFirstRunRet) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
fFirstRunRet = vchDefaultKey.empty(); |
|
|
|
fFirstRunRet = vchDefaultKey.empty(); |
|
|
|
|
|
|
|
|
|
|
|
if (mapKeys.count(vchDefaultKey)) |
|
|
|
if (!mapKeys.count(vchDefaultKey)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Set keyUser
|
|
|
|
// Create new default key
|
|
|
|
keyUser.SetPubKey(vchDefaultKey); |
|
|
|
|
|
|
|
keyUser.SetPrivKey(mapKeys[vchDefaultKey]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Create new keyUser and set as default key
|
|
|
|
|
|
|
|
RandAddSeedPerfmon(); |
|
|
|
RandAddSeedPerfmon(); |
|
|
|
|
|
|
|
|
|
|
|
vchDefaultKey = GetKeyFromKeyPool(); |
|
|
|
vchDefaultKey = GetKeyFromKeyPool(); |
|
|
|
if (!SetAddressBookName(PubKeyToAddress(vchDefaultKey), "")) |
|
|
|
if (!SetAddressBookName(PubKeyToAddress(vchDefaultKey), "")) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
CWalletDB(strWalletFile).WriteDefaultKey(keyUser.GetPubKey()); |
|
|
|
CWalletDB(strWalletFile).WriteDefaultKey(vchDefaultKey); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
CreateThread(ThreadFlushWalletDB, &strWalletFile); |
|
|
|
CreateThread(ThreadFlushWalletDB, &strWalletFile); |
|
|
|