MCPcopy Create free account
hub / github.com/ElementsProject/elements / WalletCreate

Function WalletCreate

src/wallet/wallettool.cpp:32–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32static void WalletCreate(CWallet* wallet_instance, uint64_t wallet_creation_flags)
33{
34 LOCK(wallet_instance->cs_wallet);
35
36 wallet_instance->SetMinVersion(FEATURE_LATEST);
37 wallet_instance->AddWalletFlags(wallet_creation_flags);
38
39 if (!wallet_instance->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
40 auto spk_man = wallet_instance->GetOrCreateLegacyScriptPubKeyMan();
41 spk_man->SetupGeneration(false);
42 } else {
43 wallet_instance->SetupDescriptorScriptPubKeyMans();
44 }
45
46 tfm::format(std::cout, "Topping up keypool...\n");
47 wallet_instance->TopUpKeyPool();
48}
49
50static const std::shared_ptr<CWallet> MakeWallet(const std::string& name, const fs::path& path, const ArgsManager& args, DatabaseOptions options)
51{

Callers 1

MakeWalletFunction · 0.85

Calls 8

SetMinVersionMethod · 0.80
AddWalletFlagsMethod · 0.80
IsWalletFlagSetMethod · 0.80
TopUpKeyPoolMethod · 0.80
formatFunction · 0.50
SetupGenerationMethod · 0.45

Tested by

no test coverage detected