wallet::CWallet::CreateNew

Initializes, creates and returns a new CWallet; returns a null pointer in case of an error

Synopsis

Declared in <wallet/wallet.h>

static
std::shared_ptr<CWallet>
CreateNew(
    WalletContext& context,
    std::string const& name,
    std::unique_ptr<WalletDatabase> database,
    uint64_t wallet_creation_flags,
    bool born_encrypted,
    bilingual_str& error,
    std::vector<bilingual_str>& warnings);

Return Value

The new wallet, or nullptr on failure.

Parameters

NameDescription
contextThe wallet context to create into.
nameThe name for the new wallet.
databaseThe database backend for the new wallet.
wallet_creation_flagsWallet flags to apply at creation.
born_encryptedWhether the wallet is created already encrypted.
errorSet to an error message on failure.
warningsWarnings produced while creating.