wallet::RestoreWallet

Restore a wallet from a backup file.

Synopsis

Declared in <wallet/wallet.h>

std::shared_ptr<CWallet>
RestoreWallet(
    WalletContext& context,
    fs::path const& backup_file,
    std::string const& wallet_name,
    std::optional<bool> load_on_start,
    DatabaseStatus& status,
    bilingual_str& error,
    std::vector<bilingual_str>& warnings,
    bool load_after_restore = true,
    bool allow_unnamed = false);

Return Value

The restored wallet, or nullptr on failure.

Parameters

NameDescription
contextThe wallet context to restore into.
backup_filePath to the backup file to restore from.
wallet_nameThe name to give the restored wallet.
load_on_startOptionally set whether the wallet loads on startup.
statusSet to the database status.
errorSet to an error message on failure.
warningsWarnings produced while restoring.
load_after_restoreWhether to load the wallet after restoring.
allow_unnamedWhether an empty wallet name is allowed.