HDWallet error/warning message fixes
This commit is contained in:
parent
298224b3b7
commit
9dbda86cb1
@ -1115,6 +1115,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
if (!CWallet::ParameterInteraction())
|
if (!CWallet::ParameterInteraction())
|
||||||
return false;
|
return false;
|
||||||
|
std::string strWalletFile = GetArg("-wallet", DEFAULT_WALLET_DAT);
|
||||||
#endif // ENABLE_WALLET
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
fIsBareMultisigStd = GetBoolArg("-permitbaremultisig", DEFAULT_PERMIT_BAREMULTISIG);
|
fIsBareMultisigStd = GetBoolArg("-permitbaremultisig", DEFAULT_PERMIT_BAREMULTISIG);
|
||||||
|
@ -4524,8 +4524,7 @@ bool CWallet::InitLoadWallet()
|
|||||||
|
|
||||||
if (GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET) && !walletInstance->IsHDEnabled()) {
|
if (GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET) && !walletInstance->IsHDEnabled()) {
|
||||||
if (GetArg("-mnemonicpassphrase", "").size() > 256) {
|
if (GetArg("-mnemonicpassphrase", "").size() > 256) {
|
||||||
errorString += _("Mnemonic passphrase is too long, must be at most 256 characters");
|
return UIError(_("Mnemonic passphrase is too long, must be at most 256 characters"));
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
// generate a new master key
|
// generate a new master key
|
||||||
walletInstance->GenerateNewHDChain();
|
walletInstance->GenerateNewHDChain();
|
||||||
@ -4548,13 +4547,10 @@ bool CWallet::InitLoadWallet()
|
|||||||
std::string strBackupError;
|
std::string strBackupError;
|
||||||
if(!AutoBackupWallet(walletInstance, "", strBackupWarning, strBackupError)) {
|
if(!AutoBackupWallet(walletInstance, "", strBackupWarning, strBackupError)) {
|
||||||
if (!strBackupWarning.empty()) {
|
if (!strBackupWarning.empty()) {
|
||||||
if (!warningString.empty())
|
UIWarning(strBackupWarning);
|
||||||
warningString += "\n";
|
|
||||||
warningString += strBackupWarning;
|
|
||||||
}
|
}
|
||||||
if (!strBackupError.empty()) {
|
if (!strBackupError.empty()) {
|
||||||
errorString += strBackupError;
|
return UIError(strBackupError);
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4562,22 +4558,18 @@ bool CWallet::InitLoadWallet()
|
|||||||
else if (mapArgs.count("-usehd")) {
|
else if (mapArgs.count("-usehd")) {
|
||||||
bool useHD = GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET);
|
bool useHD = GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET);
|
||||||
if (walletInstance->IsHDEnabled() && !useHD) {
|
if (walletInstance->IsHDEnabled() && !useHD) {
|
||||||
errorString += strprintf(_("Error loading %s: You can't disable HD on a already existing HD wallet"),
|
return UIError(strprintf(_("Error loading %s: You can't disable HD on a already existing HD wallet"),
|
||||||
strWalletFile);
|
walletInstance->strWalletFile));
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
if (!walletInstance->IsHDEnabled() && useHD) {
|
if (!walletInstance->IsHDEnabled() && useHD) {
|
||||||
errorString += strprintf(_("Error loading %s: You can't enable HD on a already existing non-HD wallet"),
|
return UIError(strprintf(_("Error loading %s: You can't enable HD on a already existing non-HD wallet"),
|
||||||
strWalletFile);
|
walletInstance->strWalletFile));
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Warn user every time he starts non-encrypted HD wallet
|
// Warn user every time he starts non-encrypted HD wallet
|
||||||
if (GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET) && !walletInstance->IsLocked()) {
|
if (GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET) && !walletInstance->IsLocked()) {
|
||||||
if (!warningString.empty())
|
UIWarning(_("Make sure to encrypt your wallet and delete all non-encrypted backups after you verified that wallet works!"));
|
||||||
warningString += "\n";
|
|
||||||
warningString += _("Make sure to encrypt your wallet and delete all non-encrypted backups after you verified that wallet works!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LogPrintf(" wallet %15dms\n", GetTimeMillis() - nStart);
|
LogPrintf(" wallet %15dms\n", GetTimeMillis() - nStart);
|
||||||
|
Loading…
Reference in New Issue
Block a user