From a245210cbe01b4f3f2ba7321958768e1df3df5e3 Mon Sep 17 00:00:00 2001 From: Andymeows Date: Tue, 29 Jul 2014 23:49:51 -0500 Subject: Add paper wallet generator to QT wallet --- src/pubkey.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/pubkey.cpp') 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 pubkey; + key.GetPubKey(pubkey, true); + Set(pubkey.begin(), pubkey.end()); + return true; +} + bool CPubKey::Decompress() { if (!IsValid()) return false; -- cgit v1.2.3