aboutsummaryrefslogtreecommitdiff
path: root/src/key.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/key.cpp')
-rw-r--r--src/key.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/key.cpp b/src/key.cpp
index 7092b0e0c8..5d7ea93a0f 100644
--- a/src/key.cpp
+++ b/src/key.cpp
@@ -156,7 +156,8 @@ public:
BN_clear_free(&bn);
}
- void GetPrivKey(CPrivKey &privkey) {
+ void GetPrivKey(CPrivKey &privkey, bool fCompressed) {
+ EC_KEY_set_conv_form(pkey, fCompressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED);
int nSize = i2d_ECPrivateKey(pkey, NULL);
assert(nSize);
privkey.resize(nSize);
@@ -356,7 +357,7 @@ CPrivKey CKey::GetPrivKey() const {
CECKey key;
key.SetSecretBytes(vch);
CPrivKey privkey;
- key.GetPrivKey(privkey);
+ key.GetPrivKey(privkey, fCompressed);
return privkey;
}