aboutsummaryrefslogtreecommitdiff
path: root/src/key.cpp
diff options
context:
space:
mode:
authorGiel van Schijndel <[email protected]>2012-06-17 14:30:37 +0200
committerGiel van Schijndel <[email protected]>2012-06-17 14:30:37 +0200
commit07368a9e3c60bbef8452501d34bb8d3688cbca13 (patch)
tree963f2e56176451bfeb84e54d14bf726388407b7d /src/key.cpp
parentUse the QueueShutdown signal to stop accepting new RPC connections (diff)
parentDocument how to build/run unit tests (diff)
downloaddiscoin-07368a9e3c60bbef8452501d34bb8d3688cbca13.tar.xz
discoin-07368a9e3c60bbef8452501d34bb8d3688cbca13.zip
Merge branch 'master' into async-ipv6-rpc
Conflicts: src/bitcoinrpc.cpp Signed-off-by: Giel van Schijndel <[email protected]>
Diffstat (limited to 'src/key.cpp')
-rw-r--r--src/key.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/key.cpp b/src/key.cpp
index 9485b477c..57ab842bc 100644
--- a/src/key.cpp
+++ b/src/key.cpp
@@ -239,18 +239,18 @@ CPrivKey CKey::GetPrivKey() const
return vchPrivKey;
}
-bool CKey::SetPubKey(const std::vector<unsigned char>& vchPubKey)
+bool CKey::SetPubKey(const CPubKey& vchPubKey)
{
- const unsigned char* pbegin = &vchPubKey[0];
- if (!o2i_ECPublicKey(&pkey, &pbegin, vchPubKey.size()))
+ const unsigned char* pbegin = &vchPubKey.vchPubKey[0];
+ if (!o2i_ECPublicKey(&pkey, &pbegin, vchPubKey.vchPubKey.size()))
return false;
fSet = true;
- if (vchPubKey.size() == 33)
+ if (vchPubKey.vchPubKey.size() == 33)
SetCompressedPubKey();
return true;
}
-std::vector<unsigned char> CKey::GetPubKey() const
+CPubKey CKey::GetPubKey() const
{
int nSize = i2o_ECPublicKey(pkey, NULL);
if (!nSize)
@@ -259,7 +259,7 @@ std::vector<unsigned char> CKey::GetPubKey() const
unsigned char* pbegin = &vchPubKey[0];
if (i2o_ECPublicKey(pkey, &pbegin) != nSize)
throw key_error("CKey::GetPubKey() : i2o_ECPublicKey returned unexpected size");
- return vchPubKey;
+ return CPubKey(vchPubKey);
}
bool CKey::Sign(uint256 hash, std::vector<unsigned char>& vchSig)