X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fkey.cpp;h=a1ab2a398b7377cd060f2c2191d64587446da10f;hb=b7970580fe39d1148a92de290abf6ca7e63bbfe6;hp=fe8573e532a81b9dc9a392c0369fb2c1bfeb494e;hpb=39d23056c0cf13b3e59648c159f2d4aff190992b;p=novacoin.git diff --git a/src/key.cpp b/src/key.cpp index fe8573e..a1ab2a3 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -711,6 +711,15 @@ std::string CMalleablePubKey::ToString() const return EncodeBase58Check(vch); } +std::vector CMalleablePubKey::Raw() const +{ + CDataStream ssKey(SER_NETWORK, PROTOCOL_VERSION); + ssKey << *this; + std::vector vch(ssKey.begin(), ssKey.end()); + + return vch; +} + bool CMalleablePubKey::SetString(const std::string& strMalleablePubKey) { std::vector vchTemp; @@ -771,12 +780,14 @@ CMalleableKey::CMalleableKey(const CSecret &L, const CSecret &H) SetSecrets(L, H); } +/* CMalleableKey& CMalleableKey::operator=(const CMalleableKey &b) { SetSecrets(b.vchSecretL, b.vchSecretH); return (*this); } +*/ CMalleableKey::~CMalleableKey() { @@ -792,7 +803,7 @@ bool CMalleableKey::SetSecrets(const CSecret &pvchSecretL, const CSecret &pvchSe Reset(); CKey L, H; - if (pvchSecretL.size() != 32 || !pvchSecretH.size() != 32 || !L.SetSecret(pvchSecretL, true) || !H.SetSecret(pvchSecretH, true)) + if (pvchSecretL.size() != 32 || pvchSecretH.size() != 32 || !L.SetSecret(pvchSecretL, true) || !H.SetSecret(pvchSecretH, true)) { nVersion = 0; return false; @@ -982,6 +993,15 @@ std::string CMalleableKey::ToString() const return EncodeBase58Check(vch); } +std::vector CMalleableKey::Raw() const +{ + CDataStream ssKey(SER_NETWORK, PROTOCOL_VERSION); + ssKey << *this; + std::vector vch(ssKey.begin(), ssKey.end()); + + return vch; +} + bool CMalleableKey::SetString(const std::string& strMutableKey) { std::vector vchTemp; @@ -1135,6 +1155,16 @@ bool CMalleableKeyView::SetString(const std::string& strMutableKey) return IsNull(); } +std::vector CMalleableKeyView::Raw() const +{ + CDataStream ssKey(SER_NETWORK, PROTOCOL_VERSION); + ssKey << *this; + std::vector vch(ssKey.begin(), ssKey.end()); + + return vch; +} + + bool CMalleableKeyView::IsNull() const { return nVersion != CURRENT_VERSION;