[#wallet-CWallet-CreateNew] = xref:wallet.adoc[wallet]::xref:wallet/CWallet.adoc[CWallet]::CreateNew :relfileprefix: ../../ :mrdocs: Initializes, creates and returns a new CWallet; returns a null pointer in case of an error == Synopsis Declared in `<wallet/wallet.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static std::shared_ptr<CWallet> CreateNew( xref:wallet/WalletContext.adoc[WalletContext]& context, std::string const& name, std::unique_ptr<WalletDatabase> database, uint64_t wallet_creation_flags, bool born_encrypted, xref:bilingual_str.adoc[bilingual_str]& error, std::vector<bilingual_str>& warnings); ---- == Return Value The new wallet, or nullptr on failure. == Parameters [cols="1,4"] |=== | Name| Description | *context* | The wallet context to create into. | *name* | The name for the new wallet. | *database* | The database backend for the new wallet. | *wallet_creation_flags* | Wallet flags to apply at creation. | *born_encrypted* | Whether the wallet is created already encrypted. | *error* | Set to an error message on failure. | *warnings* | Warnings produced while creating. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#