Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 4,269 Lines • ▼ Show 20 Lines | std::shared_ptr<CWallet> CWallet::CreateWalletFromFile( | ||||
if (fFirstRun) { | if (fFirstRun) { | ||||
// Ensure this wallet.dat can only be opened by clients supporting | // Ensure this wallet.dat can only be opened by clients supporting | ||||
// HD with chain split and expects no default key. | // HD with chain split and expects no default key. | ||||
walletInstance->SetMinVersion(FEATURE_LATEST); | walletInstance->SetMinVersion(FEATURE_LATEST); | ||||
walletInstance->SetWalletFlags(wallet_creation_flags, false); | walletInstance->SetWalletFlags(wallet_creation_flags, false); | ||||
// Always create LegacyScriptPubKeyMan for now | // Only create LegacyScriptPubKeyMan when not descriptor wallet | ||||
if (!walletInstance->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) { | |||||
walletInstance->SetupLegacyScriptPubKeyMan(); | walletInstance->SetupLegacyScriptPubKeyMan(); | ||||
} | |||||
if (!(wallet_creation_flags & | if (!(wallet_creation_flags & | ||||
(WALLET_FLAG_DISABLE_PRIVATE_KEYS | WALLET_FLAG_BLANK_WALLET))) { | (WALLET_FLAG_DISABLE_PRIVATE_KEYS | WALLET_FLAG_BLANK_WALLET))) { | ||||
LOCK(walletInstance->cs_wallet); | LOCK(walletInstance->cs_wallet); | ||||
for (auto spk_man : walletInstance->GetActiveScriptPubKeyMans()) { | for (auto spk_man : walletInstance->GetActiveScriptPubKeyMans()) { | ||||
if (!spk_man->SetupGeneration()) { | if (!spk_man->SetupGeneration()) { | ||||
error = _("Unable to generate initial keys"); | error = _("Unable to generate initial keys"); | ||||
return nullptr; | return nullptr; | ||||
▲ Show 20 Lines • Show All 624 Lines • Show Last 20 Lines |