diff options
| author | Andymeows <[email protected]> | 2014-07-29 23:49:51 -0500 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2015-08-07 22:16:51 +0100 |
| commit | a245210cbe01b4f3f2ba7321958768e1df3df5e3 (patch) | |
| tree | 50eb6923d11f576137cd243f55042dc3d19b5f00 /src/pubkey.cpp | |
| parent | Merge pull request #1227 from kaykurokawa/1.10-dev (diff) | |
| download | discoin-a245210cbe01b4f3f2ba7321958768e1df3df5e3.tar.xz discoin-a245210cbe01b4f3f2ba7321958768e1df3df5e3.zip | |
Add paper wallet generator to QT wallet
Diffstat (limited to 'src/pubkey.cpp')
| -rw-r--r-- | src/pubkey.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pubkey.cpp b/src/pubkey.cpp index bdab13760..ebd94c482 100644 --- a/src/pubkey.cpp +++ b/src/pubkey.cpp @@ -42,6 +42,18 @@ bool CPubKey::IsFullyValid() const { return true; } +bool CPubKey::Compress() { + if (!IsValid()) + return false; + CECKey key; + if (!key.SetPubKey(begin(), size())) + return false; + std::vector<unsigned char> pubkey; + key.GetPubKey(pubkey, true); + Set(pubkey.begin(), pubkey.end()); + return true; +} + bool CPubKey::Decompress() { if (!IsValid()) return false; |