aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2011-06-26 02:37:52 +0200
committerPieter Wuille <[email protected]>2011-06-26 02:37:52 +0200
commitd3800d59d557388b813513ef16f6b840467821d4 (patch)
tree6a106e5badc30d610bb643e40080232270f6b063 /src/wallet.cpp
parentMerge branch 'totalblocksestimate1' of https://github.com/laanwj/bitcoin (diff)
downloaddiscoin-d3800d59d557388b813513ef16f6b840467821d4.tar.xz
discoin-d3800d59d557388b813513ef16f6b840467821d4.zip
Fix segfault when creating new wallet
The initialization of the default key used keyUser instead of vchDefaultKey. keyUser is now complete removed.
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r--src/wallet.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index b06187a4b..e35bce61e 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -962,21 +962,15 @@ bool CWallet::LoadWallet(bool& fFirstRunRet)
return false;
fFirstRunRet = vchDefaultKey.empty();
- if (mapKeys.count(vchDefaultKey))
+ if (!mapKeys.count(vchDefaultKey))
{
- // Set keyUser
- keyUser.SetPubKey(vchDefaultKey);
- keyUser.SetPrivKey(mapKeys[vchDefaultKey]);
- }
- else
- {
- // Create new keyUser and set as default key
+ // Create new default key
RandAddSeedPerfmon();
vchDefaultKey = GetKeyFromKeyPool();
if (!SetAddressBookName(PubKeyToAddress(vchDefaultKey), ""))
return false;
- CWalletDB(strWalletFile).WriteDefaultKey(keyUser.GetPubKey());
+ CWalletDB(strWalletFile).WriteDefaultKey(vchDefaultKey);
}
CreateThread(ThreadFlushWalletDB, &strWalletFile);