From 1fabcee504142f9ebabda39f333aab414379e0fc Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Thu, 3 Dec 2020 22:15:27 +0100 Subject: [PATCH] fixed minor errors --- src/currency_core/account.cpp | 2 +- src/wallet/wallet_helpers.h | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/currency_core/account.cpp b/src/currency_core/account.cpp index af50caa6..85c5ba7f 100644 --- a/src/currency_core/account.cpp +++ b/src/currency_core/account.cpp @@ -235,7 +235,7 @@ namespace currency //let's validate each word for (const auto& w: words) { - if (!tools::mnemonic_encoding::valid_word(words)) + if (!tools::mnemonic_encoding::valid_word(w)) return false; } diff --git a/src/wallet/wallet_helpers.h b/src/wallet/wallet_helpers.h index 2ecfa778..12355011 100644 --- a/src/wallet/wallet_helpers.h +++ b/src/wallet/wallet_helpers.h @@ -36,10 +36,17 @@ namespace tools return API_RETURN_CODE_OK; } - if (result.syntax_correct) + if (result.syntax_correct && result.require_password) { - currency::account_base acc; - result.hash_sum_matched = acc.restore_from_seed_phrase(seed_phrase, seed_password); + if (seed_password.size()) + { + currency::account_base acc; + result.hash_sum_matched = acc.restore_from_seed_phrase(seed_phrase, seed_password); + } + else + { + result.hash_sum_matched = false; + } } return API_RETURN_CODE_OK; }