-
Notifications
You must be signed in to change notification settings - Fork 36.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multisignature and OP_EVAL support #669
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7e55c1a
Collapse no-op ExtractAddress/ExtractAddressInner
gavinandresen 1466b8b
Rework unit tests so test_bitcoin.cpp does not #include them all
gavinandresen bf79873
Support 3 new multisignature IsStandard transactions
gavinandresen cc40ba2
Global fixture to send output to console instead of debug.log
gavinandresen e679ec9
OP_EVAL implementation
gavinandresen d7062ef
Put OP_EVAL string in coinbase of generated blocks
gavinandresen fae3e2a
Disable addmultisigaddress if not testnet
gavinandresen a0871af
Interpret OP_EVAL as OP_NOP until Feb 1, 2012
gavinandresen 2a45a49
Use block times for 'hard' OP_EVAL switchover, and refactored EvalScript
gavinandresen be237c1
Fix logic for IsChange() for send-to-self transactions.
gavinandresen 9e47058
Update bitcoin address numbers for latest luke-jr/sipa scheme
gavinandresen 77f21f1
include util.h to get SecureString definition.
gavinandresen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
- Loading branch information
commit e679ec969c8b22c676ebb10bea1038f6c8f13b33
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,10 @@ class CKeyStore | |
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 @@ class CKeyStore | |
}; | ||
|
||
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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mapData is not a very descriptive name, don't all maps contain data? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hate naming things... must be my Australian roots. I'll call it Bruce. |
||
|
||
public: | ||
bool AddKey(const CKey& key); | ||
|
@@ -86,6 +92,9 @@ class CBasicKeyStore : public CKeyStore | |
} | ||
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; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add comments in keystore.h and db.h indicating why you might want to store scripts keyed by hash in your wallet, as this is not obvious at all given the readers basic mental model of how Bitcoin works.