mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
Make sure we set the wallets min version to FEATURE_HD_SPLIT at the very first point
This commit is contained in:
parent
1b3b5c6f8f
commit
771a304ffe
@ -3682,13 +3682,14 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile)
|
|||||||
{
|
{
|
||||||
// Create new keyUser and set as default key
|
// Create new keyUser and set as default key
|
||||||
if (GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET) && !walletInstance->IsHDEnabled()) {
|
if (GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET) && !walletInstance->IsHDEnabled()) {
|
||||||
|
|
||||||
|
// ensure this wallet.dat can only be opened by clients supporting HD with chain split
|
||||||
|
walletInstance->SetMinVersion(FEATURE_HD_SPLIT);
|
||||||
|
|
||||||
// generate a new master key
|
// generate a new master key
|
||||||
CPubKey masterPubKey = walletInstance->GenerateNewHDMasterKey();
|
CPubKey masterPubKey = walletInstance->GenerateNewHDMasterKey();
|
||||||
if (!walletInstance->SetHDMasterKey(masterPubKey))
|
if (!walletInstance->SetHDMasterKey(masterPubKey))
|
||||||
throw std::runtime_error(std::string(__func__) + ": Storing master key failed");
|
throw std::runtime_error(std::string(__func__) + ": Storing master key failed");
|
||||||
|
|
||||||
// ensure this wallet.dat can only be opened by clients supporting HD with chain split
|
|
||||||
walletInstance->SetMinVersion(FEATURE_HD_SPLIT);
|
|
||||||
}
|
}
|
||||||
CPubKey newDefaultKey;
|
CPubKey newDefaultKey;
|
||||||
if (walletInstance->GetKeyFromPool(newDefaultKey, false)) {
|
if (walletInstance->GetKeyFromPool(newDefaultKey, false)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user