diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2013-05-03 14:33:02 -0700 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-05-03 14:33:02 -0700 |
commit | 61a845dcb6528bc9b04272f73d4d5681be858a6f (patch) | |
tree | 48cd87c19d675e00bd328d682f033acff54e57ae /src/init.cpp | |
parent | aa62b2c43390d2a5f2b8cdc5b0674b6798d60c29 (diff) | |
parent | 360cfe142c552ac5c4d904a1e970390188151ca8 (diff) |
Merge pull request #2566 from sipa/nodef
Allow the default key to be unavailable
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/init.cpp b/src/init.cpp index ea380f5a46..3775790b68 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -966,11 +966,11 @@ bool AppInit2(boost::thread_group& threadGroup) RandAddSeedPerfmon(); CPubKey newDefaultKey; - if (!pwalletMain->GetKeyFromPool(newDefaultKey, false)) - strErrors << _("Cannot initialize keypool") << "\n"; - pwalletMain->SetDefaultKey(newDefaultKey); - if (!pwalletMain->SetAddressBookName(pwalletMain->vchDefaultKey.GetID(), "")) - strErrors << _("Cannot write default address") << "\n"; + if (pwalletMain->GetKeyFromPool(newDefaultKey, false)) { + pwalletMain->SetDefaultKey(newDefaultKey); + if (!pwalletMain->SetAddressBookName(pwalletMain->vchDefaultKey.GetID(), "")) + strErrors << _("Cannot write default address") << "\n"; + } } printf("%s", strErrors.str().c_str()); |