Adding a Compress method to the CPubKey class to mirror the Decompress method
This commit is contained in:
parent
44228bbc26
commit
ec6887b845
10
src/key.cpp
10
src/key.cpp
|
@ -509,6 +509,16 @@ bool CPubKey::IsFullyValid() const {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CPubKey::Compress() {
|
||||
if (!IsValid())
|
||||
return false;
|
||||
CECKey key;
|
||||
if (!key.SetPubKey(*this))
|
||||
return false;
|
||||
key.GetPubKey(*this, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CPubKey::Decompress() {
|
||||
if (!IsValid())
|
||||
return false;
|
||||
|
|
|
@ -163,6 +163,9 @@ public:
|
|||
// Recover a public key from a compact signature.
|
||||
bool RecoverCompact(const uint256 &hash, const std::vector<unsigned char>& vchSig);
|
||||
|
||||
// Turn this public key into a compressed public key.
|
||||
bool Compress();
|
||||
|
||||
// Turn this public key into an uncompressed public key.
|
||||
bool Decompress();
|
||||
|
||||
|
|
Loading…
Reference in a new issue