}
CMalleablePubKey(const std::string& strMalleablePubKey) { SetString(strMalleablePubKey); }
CMalleablePubKey(const CPubKey &pubKeyInL, const CPubKey &pubKeyInH) : pubKeyL(pubKeyInL), pubKeyH(pubKeyInH) { nVersion = CMalleablePubKey::CURRENT_VERSION; }
- CMalleablePubKey(const std::vector<unsigned char> &pubKeyInL, const std::vector<unsigned char> &pubKeyInH) : pubKeyL(pubKeyInL), pubKeyH(pubKeyInH) { nVersion = CMalleablePubKey::CURRENT_VERSION; }
IMPLEMENT_SERIALIZE(
READWRITE(this->nVersion);
void Reset();
void MakeNewKeys();
bool IsNull() const;
+ bool IsValid() const { return !IsNull() && GetMalleablePubKey().IsValid(); }
bool SetSecrets(const CSecret &pvchSecretL, const CSecret &pvchSecretH);
- void GetSecrets(CSecret &pvchSecretL, CSecret &pvchSecretH) const;
+
+ CSecret GetSecretL() const { return vchSecretL; }
+ CSecret GetSecretH() const { return vchSecretH; }
CKeyID GetID() const {
return GetMalleablePubKey().GetID();
public:
CMalleableKeyView() { nVersion = 0; };
CMalleableKeyView(const CMalleableKey &b);
- CMalleableKeyView(const CSecret &L, const CPubKey &pvchPubKeyH);
CMalleableKeyView(const CMalleableKeyView &b);
CMalleableKeyView& operator=(const CMalleableKey &b);
~CMalleableKeyView();
-
IMPLEMENT_SERIALIZE(
READWRITE(this->nVersion);
nVersion = this->nVersion;
)
bool IsNull() const;
+ bool IsValid() const { return !IsNull() && GetMalleablePubKey().IsValid(); }
std::string ToString() const;
bool SetString(const std::string& strMalleablePubKey);
std::vector<unsigned char> Raw() const;
return GetMalleablePubKey().GetID();
}
CMalleablePubKey GetMalleablePubKey() const;
+ CMalleableKey GetMalleableKey(const CSecret &vchSecretH) const { return CMalleableKey(vchSecretL, vchSecretH); }
bool CheckKeyVariant(const CPubKey &R, const CPubKey &vchPubKeyVariant) const;
bool operator <(const CMalleableKeyView& kv) const { return vchPubKeyH.GetID() < kv.vchPubKeyH.GetID(); }