23 wallet->WalletLogPrintf(
"Releasing wallet\n");
45 std::vector<bilingual_str> warnings;
57 }
catch (
const std::runtime_error&) {
58 tfm::format(std::cerr,
"Error loading %s. Is wallet being used by another process?\n",
name);
66 for (
const auto &
warning : warnings) {
83 tfm::format(std::cout,
"Wallet info\n===========\n");
97 tfm::format(std::cerr,
"The -dumpfile option can only be used with the \"dump\" and \"createfromdump\" commands.\n");
101 tfm::format(std::cerr,
"Wallet name must be provided when creating a new wallet.\n");
109 tfm::format(std::cerr,
"Wallet name cannot be empty\n");
123 }
else if (
command ==
"info") {
131 }
else if (
command ==
"dump") {
153 tfm::format(std::cout,
"The dumpfile may contain private keys. To ensure the safety of your Bitcoin, do not share the dumpfile.\n");
155 }
else if (
command ==
"createfromdump") {
157 std::vector<bilingual_str> warnings;
159 for (
const auto&
warning : warnings) {
#define Assert(val)
Identity function.
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
DBErrors PopulateWalletFromDB(bilingual_str &error, std::vector< bilingual_str > &warnings)
static path PathFromString(const std::string &string)
Convert byte string to path object.
fs::path AbsPathJoin(const fs::path &base, const fs::path &path)
Helper function for joining two paths.
void ReadDatabaseArgs(const ArgsManager &args, DatabaseOptions &options)
std::unique_ptr< WalletDatabase > MakeDatabase(const fs::path &path, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error)
DBErrors
Overview of wallet database classes:
bool CreateFromDump(const ArgsManager &args, const std::string &name, const fs::path &wallet_path, bilingual_str &error, std::vector< bilingual_str > &warnings)
fs::path GetWalletDir()
Get the path of the wallet directory.
bool IsBDBFile(const fs::path &path)
fs::path BDBDataFile(const fs::path &wallet_path)
bool DumpWallet(const ArgsManager &args, WalletDatabase &db, bilingual_str &error)
@ WALLET_FLAG_DESCRIPTORS
Indicate that this wallet supports DescriptorScriptPubKeyMan.
std::optional< DatabaseFormat > require_format
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.