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

Name

Description

context

The wallet context to restore into.

backup_file

Path to the backup file to restore from.

wallet_name

The name to give the restored wallet.

load_on_start

Optionally set whether the wallet loads on startup.

status

Set to the database status.

error

Set to an error message on failure.

warnings

Warnings produced while restoring.

load_after_restore

Whether to load the wallet after restoring.

allow_unnamed

Whether an empty wallet name is allowed.

Created with MrDocs