Make wallet_propose seed generation consistent:

Allow 'seed' or 'seed_hex' if 'key_type' is not specified.
Use legacy passphrase seed generation if 'key_type' is specified.
This commit is contained in:
wilsonianb
2016-04-19 11:09:06 -07:00
committed by Nik Bougalis
parent 89c05efe22
commit 5e5d5fdee4
3 changed files with 80 additions and 55 deletions

View File

@@ -30,9 +30,6 @@ namespace RPC {
boost::optional<Seed>
getSeedFromRPC (Json::Value const& params)
{
// This function is only called when `key_type` is present.
assert (params.isMember (jss::key_type));
bool const hasPassphrase = params.isMember (jss::passphrase);
bool const hasSeed = params.isMember (jss::seed);
bool const hasHexSeed = params.isMember (jss::seed_hex);
@@ -48,7 +45,7 @@ getSeedFromRPC (Json::Value const& params)
return parseBase58<Seed> (params[jss::seed].asString());
if (hasPassphrase)
return generateSeed (params[jss::passphrase].asString());
return parseGenericSeed (params[jss::passphrase].asString());
if (hasHexSeed)
{