原始文献 / 论坛帖 / Re: Exception: 9key_error error

Re: Exception: 9key_error error

Bitcointalk · 2010-05-16 22:53:59 UTC

AuthorSatoshi Nakamoto
TitleRe: Exception: 9key_error error
Date2010-05-16 22:53:59 UTC
ForumBitcointalk · 原文

是每次运行都这样,还是某次随机出现的一次?

我以前没见它失败过。那是对 OpenSSL 的一次调用,我以为它永远不会失败,只是以防万一加了个错误检查。我想不出它怎么会失败。可能是内存耗尽。

代码是:

key.h:
EC_KEY* pkey;

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

NID_secp256k1 是个常量。

英文原文

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

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

The code is:

key.h:
    EC_KEY* pkey;

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

NID_secp256k1 is a constant.