Skip to content

Commit

Permalink
Fixing crash on non-HD wallet. (#1001)
Browse files Browse the repository at this point in the history
* Fixing crash on non-HD wallet

* Not show recovery screen when -usehd=0 is set
  • Loading branch information
levonpetrosyan93 authored Feb 15, 2021
1 parent a2d8ba8 commit 5c372f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/qt/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"){
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2981,7 +2981,7 @@ std::vector<unsigned char> CWallet::EncryptMintAmount(uint64_t amount, const sec
}

bool CWallet::DecryptMintAmount(const std::vector<unsigned char>& encryptedValue, const secp_primitives::GroupElement& pubcoin, uint64_t& amount) const {
if(IsLocked()) {
if (IsLocked() || hdChain.masterKeyID.IsNull()) {
amount = 0;
return true;
}
Expand Down

0 comments on commit 5c372f2

Please sign in to comment.