[#wallet-CWallet-LoadExisting]
= xref:wallet.adoc[wallet]::xref:wallet/CWallet.adoc[CWallet]::LoadExisting
:relfileprefix: ../../
:mrdocs:

Initializes, loads, and returns a CWallet from an existing wallet&semi; returns a null pointer in case of an error

== Synopsis

Declared in `&lt;wallet&sol;wallet&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
std::shared&lowbar;ptr&lt;CWallet&gt;
LoadExisting(
    xref:wallet/WalletContext.adoc[WalletContext]& context,
    std::string const& name,
    std::unique&lowbar;ptr&lt;WalletDatabase&gt; database,
    xref:bilingual_str.adoc[bilingual&lowbar;str]& error,
    std::vector&lt;bilingual&lowbar;str&gt;& warnings);
----

== Return Value

The loaded wallet, or nullptr on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *context*
| The wallet context to load into&period;
| *name*
| The name of the wallet to load&period;
| *database*
| The database backend of the existing wallet&period;
| *error*
| Set to an error message on failure&period;
| *warnings*
| Warnings produced while loading&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
