Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | LoadWallet(interfaces::Chain &chain, const std::string &name, | ||||
auto wallet = LoadWalletInternal(chain, name, load_on_start, options, | auto wallet = LoadWalletInternal(chain, name, load_on_start, options, | ||||
status, error, warnings); | status, error, warnings); | ||||
WITH_LOCK(g_loading_wallet_mutex, g_loading_wallet_set.erase(result.first)); | WITH_LOCK(g_loading_wallet_mutex, g_loading_wallet_set.erase(result.first)); | ||||
return wallet; | return wallet; | ||||
} | } | ||||
std::shared_ptr<CWallet> | std::shared_ptr<CWallet> | ||||
CreateWallet(interfaces::Chain &chain, const std::string &name, | CreateWallet(interfaces::Chain &chain, const std::string &name, | ||||
std::optional<bool> load_on_start, const DatabaseOptions &options, | std::optional<bool> load_on_start, DatabaseOptions &options, | ||||
DatabaseStatus &status, bilingual_str &error, | DatabaseStatus &status, bilingual_str &error, | ||||
std::vector<bilingual_str> &warnings) { | std::vector<bilingual_str> &warnings) { | ||||
uint64_t wallet_creation_flags = options.create_flags; | uint64_t wallet_creation_flags = options.create_flags; | ||||
const SecureString &passphrase = options.create_passphrase; | const SecureString &passphrase = options.create_passphrase; | ||||
if (wallet_creation_flags & WALLET_FLAG_DESCRIPTORS) { | |||||
options.require_format = DatabaseFormat::SQLITE; | |||||
} | |||||
// Indicate that the wallet is actually supposed to be blank and not just | // Indicate that the wallet is actually supposed to be blank and not just | ||||
// blank to make it encrypted | // blank to make it encrypted | ||||
bool create_blank = (wallet_creation_flags & WALLET_FLAG_BLANK_WALLET); | bool create_blank = (wallet_creation_flags & WALLET_FLAG_BLANK_WALLET); | ||||
// Born encrypted wallets need to be created blank first. | // Born encrypted wallets need to be created blank first. | ||||
if (!passphrase.empty()) { | if (!passphrase.empty()) { | ||||
wallet_creation_flags |= WALLET_FLAG_BLANK_WALLET; | wallet_creation_flags |= WALLET_FLAG_BLANK_WALLET; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 4,799 Lines • Show Last 20 Lines |