Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallettool.cpp
Show All 38 Lines | static std::shared_ptr<CWallet> CreateWallet(const std::string &name, | ||||
if (load_wallet_ret != DBErrors::LOAD_OK) { | if (load_wallet_ret != DBErrors::LOAD_OK) { | ||||
tfm::format(std::cerr, "Error creating %s", name); | tfm::format(std::cerr, "Error creating %s", name); | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
wallet_instance->SetMinVersion(FEATURE_HD_SPLIT); | wallet_instance->SetMinVersion(FEATURE_HD_SPLIT); | ||||
// generate a new HD seed | // generate a new HD seed | ||||
auto spk_man = wallet_instance->GetLegacyScriptPubKeyMan(); | auto spk_man = wallet_instance->GetOrCreateLegacyScriptPubKeyMan(); | ||||
CPubKey seed = spk_man->GenerateNewSeed(); | CPubKey seed = spk_man->GenerateNewSeed(); | ||||
spk_man->SetHDSeed(seed); | spk_man->SetHDSeed(seed); | ||||
tfm::format(std::cout, "Topping up keypool...\n"); | tfm::format(std::cout, "Topping up keypool...\n"); | ||||
wallet_instance->TopUpKeyPool(); | wallet_instance->TopUpKeyPool(); | ||||
return wallet_instance; | return wallet_instance; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |