mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Allow the default key to be unavailable
This solves the issue where no default key can be added after -salvagewallet.
This commit is contained in:
parent
77a1e12eed
commit
360cfe142c
4 changed files with 32 additions and 24 deletions
10
src/init.cpp
10
src/init.cpp
|
|
@ -939,11 +939,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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue