X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fkeystore.h;h=eb38ddd7f1c4aaaabe23e14121e3b0ebeba4c6cb;hb=09bb63d7438ad8550288b852695dea78cff3babc;hp=21930603f7705e39a7b157b1f87249ca30e73789;hpb=7f70ddc68f4afa4a87a15e620ba519afbc5c8b15;p=novacoin.git diff --git a/src/keystore.h b/src/keystore.h index 2193060..eb38ddd 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -70,6 +70,7 @@ public: } virtual bool CheckOwnership(const CPubKey &pubKeyVariant, const CPubKey &R) const =0; + virtual bool CheckOwnership(const CPubKey &pubKeyVariant, const CPubKey &R, CMalleableKeyView &view) const =0; virtual bool CreatePrivKey(const CPubKey &pubKeyVariant, const CPubKey &R, CKey &privKey) const =0; virtual void ListMalleableViews(std::list &malleableViewList) const =0; }; @@ -120,12 +121,8 @@ public: setAddress.clear(); { LOCK(cs_KeyStore); - KeyMap::const_iterator mi = mapKeys.begin(); - while (mi != mapKeys.end()) - { - setAddress.insert((*mi).first); - mi++; - } + KeyMap::const_iterator mi; + for (mi = mapKeys.begin(); mi != mapKeys.end(); ++mi) setAddress.insert((*mi).first); } } bool GetKey(const CKeyID &address, CKey &keyOut) const @@ -164,6 +161,22 @@ public: return false; } + bool CheckOwnership(const CPubKey &pubKeyVariant, const CPubKey &R, CMalleableKeyView &view) const + { + { + LOCK(cs_KeyStore); + for (MalleableKeyMap::const_iterator mi = mapMalleableKeys.begin(); mi != mapMalleableKeys.end(); mi++) + { + if (mi->first.CheckKeyVariant(R, pubKeyVariant)) + { + view = mi->first; + return true; + } + } + } + return false; + } + bool CreatePrivKey(const CPubKey &pubKeyVariant, const CPubKey &R, CKey &privKey) const { {