Browse Source

Fix --sign-tx in ethkey.

cl-refactor
Gav Wood 10 years ago
parent
commit
18d9398525
  1. 17
      ethkey/KeyAux.h
  2. 9
      libdevcore/FixedHash.cpp

17
ethkey/KeyAux.h

@ -228,17 +228,16 @@ public:
{
if (h128 u = fromUUID(_signKey))
return Secret(secretStore().secret(u, [&](){ return getPassword("Enter password for key: "); }));
else if (Address a = Address(_signKey))
return keyManager().secret(a, [&](){ return getPassword("Enter password for key (hint:" + keyManager().passwordHint(a) + "): "); });
else if (_signKey.substr(0, 6) == "brain:")
if (_signKey.substr(0, 6) == "brain:")
return KeyManager::brain(_signKey.substr(6));
else if (_signKey == "brain")
if (_signKey == "brain")
return KeyManager::brain(getPassword("Enter brain wallet phrase: "));
else
{
cerr << "Bad file, UUID and address: " << _signKey << endl;
exit(-1);
}
Address a;
DEV_IGNORE_EXCEPTIONS(a = Address(_signKey));
if (a)
return keyManager().secret(a, [&](){ return getPassword("Enter password for key (hint:" + keyManager().passwordHint(a) + "): "); });
cerr << "Bad file, UUID and address: " << _signKey << endl;
exit(-1);
}
}

9
libdevcore/FixedHash.cpp

@ -30,7 +30,14 @@ boost::random_device dev::s_fixedHashEngine;
h128 dev::fromUUID(std::string const& _uuid)
{
return h128(boost::replace_all_copy(_uuid, "-", ""));
try
{
return h128(boost::replace_all_copy(_uuid, "-", ""));
}
catch (...)
{
return h128();
}
}
std::string dev::toUUID(h128 const& _uuid)

Loading…
Cancel
Save