# Re: Exception: 9key_error error

Post by: satoshi on May 16, 2010, 10:53:59 PM

Does it happen every time you run it, or just happened once at some random time?

I've never seen that fail before. &nbsp;It's a call to OpenSSL that I assumed would never fail, but I put an error check there just in case. &nbsp;I can't imagine how it would fail. &nbsp;Out of memory maybe.

The code is:

key.h:
&nbsp;&nbsp;&nbsp;&nbsp;EC_KEY* pkey;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pkey = EC_KEY_new_by_curve_name(NID_secp256k1);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (pkey == NULL)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw key_error("CKey::CKey() : EC_KEY_new_by_curve_name failed");

NID_secp256k1 is a constant.

---

Source file: bitcoin-forum-satoshi-nakamoto.tgz

External link: https://bitcointalk.org/index.php?topic=135.msg1133#msg1133
