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; }