summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmir Taaki <genjix@riseup.net>2014-05-08 20:31:34 (GMT)
committer Amir Taaki <genjix@riseup.net>2014-05-08 20:31:34 (GMT)
commit8b7b605a3dff442bfbfc70419743a6a09fca0f59 (patch)
tree5964ebd25d38de2595708fa92ec762c2f0e59b1d
parent023146cc4213c234479611d043e97812b25445b2 (diff)
allow pubkey command to also take in secrets
-rw-r--r--src/util.hpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/util.hpp b/src/util.hpp
index be2c603..c0dc272 100644
--- a/src/util.hpp
+++ b/src/util.hpp
@@ -53,8 +53,13 @@ std::string read_stdin()
bool read_private_key(elliptic_curve_key& key, const std::string& arg,
int is_compressed=-1)
{
- secret_parameter secret = libwallet::wif_to_secret(arg);
- bool compressed_flag = libwallet::is_wif_compressed(arg);
+ secret_parameter secret = decode_hex_digest<secret_parameter>(arg);
+ bool compressed_flag = true;
+ if (secret == null_hash)
+ {
+ secret = libwallet::wif_to_secret(arg);
+ compressed_flag = libwallet::is_wif_compressed(arg);
+ }
// Overrides for compression
if (is_compressed == 0)
compressed_flag = false;