From c4f45dbce0b9e5abdeb9048048e8de9fce04ebf5 Mon Sep 17 00:00:00 2001 From: Levon Petrosyan Date: Mon, 15 Feb 2021 04:40:00 +0400 Subject: [PATCH 1/2] Fixing crash on non-HD wallet --- src/wallet/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4ef9b13f5b..d319cf7651 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2981,7 +2981,7 @@ std::vector CWallet::EncryptMintAmount(uint64_t amount, const sec } bool CWallet::DecryptMintAmount(const std::vector& encryptedValue, const secp_primitives::GroupElement& pubcoin, uint64_t& amount) const { - if(IsLocked()) { + if (IsLocked() || hdChain.masterKeyID.IsNull()) { amount = 0; return true; } From 5c3789ee5f8df3dd4bb9b2e2ff1befccea1376f8 Mon Sep 17 00:00:00 2001 From: Levon Petrosyan Date: Mon, 15 Feb 2021 04:41:59 +0400 Subject: [PATCH 2/2] Not show recovery screen when -usehd=0 is set --- src/qt/bitcoin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index b5a4d79150..db26437bb8 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -763,8 +763,8 @@ int main(int argc, char *argv[]) // - Using mnemonic (-usemnemonic on (default)) and // - mnemonic not set (default, not setting mnemonic from conf file instead) and // - hdseed not set (default, not setting hd seed from conf file instead) - - if(GetBoolArg("-usemnemonic", DEFAULT_USE_MNEMONIC) && + if(GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET) && + GetBoolArg("-usemnemonic", DEFAULT_USE_MNEMONIC) && !GetBoolArg("-disablewallet", false) && GetArg("-mnemonic", "").empty() && GetArg("-hdseed", "not hex")=="not hex"){