Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallettool.cpp
Show All 36 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 | ||||
CPubKey seed = wallet_instance->GenerateNewSeed(); | auto spk_man = wallet_instance->GetLegacyScriptPubKeyMan(); | ||||
wallet_instance->SetHDSeed(seed); | CPubKey seed = spk_man->GenerateNewSeed(); | ||||
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; | ||||
} | } | ||||
static std::shared_ptr<CWallet> LoadWallet(const std::string &name, | static std::shared_ptr<CWallet> LoadWallet(const std::string &name, | ||||
const fs::path &path) { | const fs::path &path) { | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
static void WalletShowInfo(CWallet *wallet_instance) { | static void WalletShowInfo(CWallet *wallet_instance) { | ||||
LOCK(wallet_instance->cs_wallet); | LOCK(wallet_instance->cs_wallet); | ||||
tfm::format(std::cout, "Wallet info\n===========\n"); | tfm::format(std::cout, "Wallet info\n===========\n"); | ||||
tfm::format(std::cout, "Encrypted: %s\n", | tfm::format(std::cout, "Encrypted: %s\n", | ||||
wallet_instance->IsCrypted() ? "yes" : "no"); | wallet_instance->IsCrypted() ? "yes" : "no"); | ||||
tfm::format(std::cout, "HD (hd seed available): %s\n", | tfm::format(std::cout, "HD (hd seed available): %s\n", | ||||
wallet_instance->GetHDChain().seed_id.IsNull() ? "no" : "yes"); | wallet_instance->IsHDEnabled() ? "yes" : "no"); | ||||
tfm::format(std::cout, "Keypool Size: %u\n", | tfm::format(std::cout, "Keypool Size: %u\n", | ||||
wallet_instance->GetKeyPoolSize()); | wallet_instance->GetKeyPoolSize()); | ||||
tfm::format(std::cout, "Transactions: %zu\n", | tfm::format(std::cout, "Transactions: %zu\n", | ||||
wallet_instance->mapWallet.size()); | wallet_instance->mapWallet.size()); | ||||
tfm::format(std::cout, "Address Book: %zu\n", | tfm::format(std::cout, "Address Book: %zu\n", | ||||
wallet_instance->mapAddressBook.size()); | wallet_instance->mapAddressBook.size()); | ||||
} | } | ||||
Show All 37 Lines |