Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallettool.cpp
Show First 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | static bool SalvageWallet(const fs::path &path) { | ||||
} | } | ||||
if (!error_string.original.empty()) { | if (!error_string.original.empty()) { | ||||
tfm::format(std::cerr, "Failed to open wallet for salvage :%s\n", | tfm::format(std::cerr, "Failed to open wallet for salvage :%s\n", | ||||
error_string.original); | error_string.original); | ||||
return false; | return false; | ||||
} | } | ||||
// Perform the recovery | // Perform the recovery | ||||
CWallet dummy_wallet(Params(), nullptr, WalletLocation(), | return RecoverDatabaseFile(path); | ||||
WalletDatabase::CreateDummy()); | |||||
std::string backup_filename; | |||||
return RecoverDatabaseFile(path, (void *)&dummy_wallet, | |||||
RecoverKeysOnlyFilter, backup_filename); | |||||
} | } | ||||
bool ExecuteWalletToolFunc(const std::string &command, | bool ExecuteWalletToolFunc(const std::string &command, | ||||
const std::string &name) { | const std::string &name) { | ||||
fs::path path = fs::absolute(name, GetWalletDir()); | fs::path path = fs::absolute(name, GetWalletDir()); | ||||
if (command == "create") { | if (command == "create") { | ||||
std::shared_ptr<CWallet> wallet_instance = CreateWallet(name, path); | std::shared_ptr<CWallet> wallet_instance = CreateWallet(name, path); | ||||
Show All 36 Lines |