mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 13:32:47 +01:00
Make compressed pubkeys require 0.6.0
This commit is contained in:
parent
9976cf070f
commit
38067c18f8
@ -114,7 +114,7 @@ public:
|
|||||||
return fCompressedPubKey;
|
return fCompressedPubKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeNewKey(bool fCompressed = true)
|
void MakeNewKey(bool fCompressed)
|
||||||
{
|
{
|
||||||
if (!EC_KEY_generate_key(pkey))
|
if (!EC_KEY_generate_key(pkey))
|
||||||
throw key_error("CKey::MakeNewKey() : EC_KEY_generate_key failed");
|
throw key_error("CKey::MakeNewKey() : EC_KEY_generate_key failed");
|
||||||
|
@ -17,9 +17,16 @@ using namespace std;
|
|||||||
|
|
||||||
std::vector<unsigned char> CWallet::GenerateNewKey()
|
std::vector<unsigned char> CWallet::GenerateNewKey()
|
||||||
{
|
{
|
||||||
|
bool fCompressed = true; // default to compressed public keys
|
||||||
|
|
||||||
RandAddSeedPerfmon();
|
RandAddSeedPerfmon();
|
||||||
CKey key;
|
CKey key;
|
||||||
key.MakeNewKey();
|
key.MakeNewKey(fCompressed);
|
||||||
|
|
||||||
|
// Compressed public keys were introduced in version 0.6.0
|
||||||
|
if (fCompressed)
|
||||||
|
SetMinVersion(59900);
|
||||||
|
|
||||||
if (!AddKey(key))
|
if (!AddKey(key))
|
||||||
throw std::runtime_error("CWallet::GenerateNewKey() : AddKey failed");
|
throw std::runtime_error("CWallet::GenerateNewKey() : AddKey failed");
|
||||||
return key.GetPubKey();
|
return key.GetPubKey();
|
||||||
|
Loading…
Reference in New Issue
Block a user