diff options
| author | Max K. <[email protected]> | 2015-08-07 23:29:55 +0200 |
|---|---|---|
| committer | Max K. <[email protected]> | 2015-08-07 23:29:55 +0200 |
| commit | 5123a058ec53619667a996ec7f1360504c27d693 (patch) | |
| tree | 3153542bcb61b0e616f011867149f379e2951a81 /src/pubkey.cpp | |
| parent | Merge pull request #1227 from kaykurokawa/1.10-dev (diff) | |
| parent | Replace print icon with Typeicons equivalent (diff) | |
| download | discoin-5123a058ec53619667a996ec7f1360504c27d693.tar.xz discoin-5123a058ec53619667a996ec7f1360504c27d693.zip | |
Merge pull request #1224 from rnicoll/1.10-paperwallet
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; |