Merge pull request #343 from svost/c++11
[novacoin.git] / src / keystore.h
index 438752f..65398a1 100644 (file)
@@ -132,7 +132,6 @@ public:
             KeyMap::const_iterator mi = mapKeys.find(address);
             if (mi != mapKeys.end())
             {
-                keyOut.Reset();
                 keyOut.SetSecret((*mi).second.first, (*mi).second.second);
                 return true;
             }
@@ -238,6 +237,9 @@ private:
     // if fUseCrypto is false, vMasterKey must be empty
     bool fUseCrypto;
 
+    // keeps track of whether Unlock has run a thorough check before
+    bool fDecryptionThoroughlyChecked;
+
 protected:
     bool SetCrypted();
 
@@ -248,7 +250,7 @@ protected:
     bool Unlock(const CKeyingMaterial& vMasterKeyIn);
 
 public:
-    CCryptoKeyStore() : fUseCrypto(false) { }
+    CCryptoKeyStore() : fUseCrypto(false), fDecryptionThoroughlyChecked(false) { }
 
     bool IsCrypted() const
     {
@@ -336,6 +338,12 @@ public:
         return false;
     }
 
+    bool CheckOwnership(const CMalleablePubKey &mpk)
+    {
+        CMalleableKeyView view;
+        return GetMalleableView(mpk, view);
+    }
+
     bool CreatePrivKey(const CPubKey &pubKeyVariant, const CPubKey &R, CKey &privKey) const;
 
     void ListMalleableViews(std::list<CMalleableKeyView> &malleableViewList) const