diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2011-11-08 13:20:29 -0500 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2011-12-19 13:24:48 -0500 |
commit | 2a45a494b0bec6a0f1fc6ab7f26c260b85e7ff3e (patch) | |
tree | a6c8ad492ea81d6f1c2b8694351a7b7bfa785ae6 /src/keystore.h | |
parent | a0871afb2b1d6d358c833fd08bca2f13c840fd4d (diff) |
Use block times for 'hard' OP_EVAL switchover, and refactored EvalScript
so it takes a flag for how to interpret OP_EVAL.
Also increased IsStandard size of scriptSigs to 500 bytes, so
a 3-of-3 multisig transaction IsStandard.
Diffstat (limited to 'src/keystore.h')
-rw-r--r-- | src/keystore.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/keystore.h b/src/keystore.h index 942fb9ae9c..669bf90174 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -6,6 +6,7 @@ #define BITCOIN_KEYSTORE_H #include "crypter.h" +#include "script.h" // A virtual base class for key stores class CKeyStore @@ -31,9 +32,10 @@ public: virtual void GetKeys(std::set<CBitcoinAddress> &setAddress) const =0; virtual bool GetPubKey(const CBitcoinAddress &address, std::vector<unsigned char>& vchPubKeyOut) const; - virtual bool AddCScript(const uint160 &hash, const std::vector<unsigned char>& data) =0; + // Support for BIP 0013 : see https://en.bitcoin.it/wiki/BIP_0013 + virtual bool AddCScript(const uint160 &hash, const CScript& redeemScript) =0; virtual bool HaveCScript(const uint160 &hash) const =0; - virtual bool GetCScript(const uint160 &hash, std::vector<unsigned char>& dataOut) const =0; + virtual bool GetCScript(const uint160 &hash, CScript& redeemScriptOut) const =0; // Generate a new key, and add it to the store virtual std::vector<unsigned char> GenerateNewKey(); @@ -48,14 +50,14 @@ public: }; typedef std::map<CBitcoinAddress, CSecret> KeyMap; -typedef std::map<uint160, std::vector<unsigned char> > DataMap; +typedef std::map<uint160, CScript > ScriptMap; // Basic key store, that keeps keys in an address->secret map class CBasicKeyStore : public CKeyStore { protected: KeyMap mapKeys; - DataMap mapData; + ScriptMap mapScripts; public: bool AddKey(const CKey& key); @@ -92,9 +94,9 @@ public: } return false; } - virtual bool AddCScript(const uint160 &hash, const std::vector<unsigned char>& data); + virtual bool AddCScript(const uint160 &hash, const CScript& redeemScript); virtual bool HaveCScript(const uint160 &hash) const; - virtual bool GetCScript(const uint160 &hash, std::vector<unsigned char>& dataOut) const; + virtual bool GetCScript(const uint160 &hash, CScript& redeemScriptOut) const; }; typedef std::map<CBitcoinAddress, std::pair<std::vector<unsigned char>, std::vector<unsigned char> > > CryptedKeyMap; |