Refactor: Allow LegacyScriptPubKeyMan to be null

In CWallet::LoadWallet, use this to detect and empty wallet with no keys

This commit does not change behavior.
This commit is contained in:
Andrew Chow
2019-10-07 14:11:34 -04:00
parent fadc08ad94
commit eb81fc3ee5
15 changed files with 86 additions and 37 deletions

View File

@@ -38,7 +38,7 @@ static std::shared_ptr<CWallet> CreateWallet(const std::string& name, const fs::
wallet_instance->SetMinVersion(FEATURE_HD_SPLIT);
// generate a new HD seed
auto spk_man = wallet_instance->GetLegacyScriptPubKeyMan();
auto spk_man = wallet_instance->GetOrCreateLegacyScriptPubKeyMan();
CPubKey seed = spk_man->GenerateNewSeed();
spk_man->SetHDSeed(seed);