diff options
| author | Gavin Andresen <[email protected]> | 2011-10-03 13:05:43 -0400 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2011-12-19 12:40:19 -0500 |
| commit | e679ec969c8b22c676ebb10bea1038f6c8f13b33 (patch) | |
| tree | c584f1a152c376ca0df93261d447c5b719449508 /src/keystore.h | |
| parent | Global fixture to send output to console instead of debug.log (diff) | |
| download | discoin-e679ec969c8b22c676ebb10bea1038f6c8f13b33.tar.xz discoin-e679ec969c8b22c676ebb10bea1038f6c8f13b33.zip | |
OP_EVAL implementation
OP_EVAL is a new opcode that evaluates an item on the stack as a script.
It enables a new type of bitcoin address that needs an arbitrarily
complex script to redeem.
Diffstat (limited to 'src/keystore.h')
| -rw-r--r-- | src/keystore.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/keystore.h b/src/keystore.h index 3b91de6fb..942fb9ae9 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -31,6 +31,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; + virtual bool HaveCScript(const uint160 &hash) const =0; + virtual bool GetCScript(const uint160 &hash, std::vector<unsigned char>& dataOut) const =0; + // Generate a new key, and add it to the store virtual std::vector<unsigned char> GenerateNewKey(); virtual bool GetSecret(const CBitcoinAddress &address, CSecret& vchSecret) const @@ -44,12 +48,14 @@ public: }; typedef std::map<CBitcoinAddress, CSecret> KeyMap; +typedef std::map<uint160, std::vector<unsigned char> > DataMap; // Basic key store, that keeps keys in an address->secret map class CBasicKeyStore : public CKeyStore { protected: KeyMap mapKeys; + DataMap mapData; public: bool AddKey(const CKey& key); @@ -86,6 +92,9 @@ public: } return false; } + virtual bool AddCScript(const uint160 &hash, const std::vector<unsigned char>& data); + virtual bool HaveCScript(const uint160 &hash) const; + virtual bool GetCScript(const uint160 &hash, std::vector<unsigned char>& dataOut) const; }; typedef std::map<CBitcoinAddress, std::pair<std::vector<unsigned char>, std::vector<unsigned char> > > CryptedKeyMap; |