forked from lthn/blockchain
added address field to get_seed_phrase_info
This commit is contained in:
parent
db4b841f57
commit
d718d876fc
2 changed files with 26 additions and 5 deletions
|
|
@ -38,21 +38,40 @@ namespace tools
|
|||
result.hash_sum_matched = false;
|
||||
result.syntax_correct = acc.restore_from_tracking_seed(seed_phrase);
|
||||
if (result.syntax_correct)
|
||||
{
|
||||
result.tracking = true;
|
||||
result.address = acc.get_public_address_str();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result.syntax_correct = currency::account_base::is_seed_password_protected(seed_phrase, result.require_password);
|
||||
if (result.syntax_correct && result.require_password)
|
||||
if (result.syntax_correct )
|
||||
{
|
||||
if (seed_password.size())
|
||||
if (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);
|
||||
if (result.hash_sum_matched)
|
||||
{
|
||||
result.address = acc.get_public_address_str();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result.hash_sum_matched = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result.hash_sum_matched = false;
|
||||
currency::account_base acc;
|
||||
result.syntax_correct = acc.restore_from_seed_phrase(seed_phrase, "");
|
||||
if (result.syntax_correct)
|
||||
{
|
||||
result.address = acc.get_public_address_str();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -381,12 +381,14 @@ namespace wallet_public
|
|||
bool require_password;
|
||||
bool hash_sum_matched;
|
||||
bool tracking;
|
||||
std::string address;
|
||||
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(syntax_correct) DOC_DSCR("Indicates whether the syntax is correct.") DOC_EXMP(true) DOC_END
|
||||
KV_SERIALIZE(require_password) DOC_DSCR("Indicates whether a password is required.") DOC_EXMP(true) DOC_END
|
||||
KV_SERIALIZE(hash_sum_matched) DOC_DSCR("Indicates whether the hash sum matches.") DOC_EXMP(true) DOC_END
|
||||
KV_SERIALIZE(tracking) DOC_DSCR("Indicates whether tracking is enabled.") DOC_EXMP(false) DOC_END
|
||||
KV_SERIALIZE(address) DOC_DSCR("Return address of the seed phrase.") DOC_EXMP("ZxDNaMeZjwCjnHuU5gUNyrP1pM3U5vckbakzzV6dEHyDYeCpW8XGLBFTshcaY8LkG9RQn7FsQx8w2JeJzJwPwuDm2NfixPAXf") DOC_END
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue