Skip to content

Commit

Permalink
dumbwallet: better error messages for generating key
Browse files Browse the repository at this point in the history
Running 'dumbwallet setup' on Fedora 21 gave me error
"Coud not generate key". The reason is that Fedora's
OpenSSL does not currently support secp256k1.

This patch fixes the above typo and explains the user
why the key generation failed.

Signed-off-by: Tero Roponen <tero.roponen@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
terrop authored and rustyrussell committed Aug 20, 2014
1 parent 10e7c77 commit a2548a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dumbwallet.c
Expand Up @@ -68,8 +68,10 @@ static void create_wallet(const char *privkey)
EC_KEY_set_conv_form(priv, POINT_CONVERSION_COMPRESSED);
} else {
priv = EC_KEY_new_by_curve_name(NID_secp256k1);
if (!priv)
errx(1, "OpenSSL in use misses support for secp256k1");
if (EC_KEY_generate_key(priv) != 1)
errx(1, "Coud not generate key");
errx(1, "Could not generate key");
}
keystr = key_to_base58(NULL, true, priv, false);

Expand Down

0 comments on commit a2548a2

Please sign in to comment.