Skip to content

Commit e5129e6

Browse files
committed
fix: if hdseed is wrong - do not setup random seed, user can lost his fund
1 parent e52498b commit e5129e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/wallet/wallet.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4609,7 +4609,8 @@ std::shared_ptr<CWallet> CWallet::Create(interfaces::Chain& chain, interfaces::C
46094609
newHdChain.AddAccount();
46104610
} else {
46114611
if (gArgs.IsArgSet("-hdseed") && !IsHex(strSeed)) {
4612-
walletInstance->WalletLogPrintf("%s -- Incorrect seed, generating a random mnemonic instead\n", __func__);
4612+
error = strprintf(_("%s -- Incorrect seed, it should be a hex string"), __func__);
4613+
return nullptr;
46134614
}
46144615
SecureString secureMnemonic = gArgs.GetArg("-mnemonic", "").c_str();
46154616
SecureString secureMnemonicPassphrase = gArgs.GetArg("-mnemonicpassphrase", "").c_str();

0 commit comments

Comments
 (0)