diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-10-22 12:08:51 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-10-22 12:16:50 +0200 |
| commit | 25cc1cf8dc03b9ba0ae886d354855adc207b5b6e (patch) | |
| tree | 9298713771596e3ef2c45eb98b3564a995af7978 /src/script/standard.cpp | |
| parent | Merge pull request #4988 (diff) | |
| parent | script: add a slew of includes all around and drop includes from script.h (diff) | |
| download | discoin-25cc1cf8dc03b9ba0ae886d354855adc207b5b6e.tar.xz discoin-25cc1cf8dc03b9ba0ae886d354855adc207b5b6e.zip | |
Merge pull request #4981
85c579e script: add a slew of includes all around and drop includes from script.h (Cory Fields)
db8eb54 script: move ToString and ValueString out of the header (Cory Fields)
e9ca428 script: add ToByteVector() for converting anything with begin/end (Cory Fields)
066e2a1 script: move CScriptID to standard.h and add a ctor for creating them from CScripts (Cory Fields)
Diffstat (limited to 'src/script/standard.cpp')
| -rw-r--r-- | src/script/standard.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 53ae254d5..05938961b 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -7,6 +7,7 @@ #include "script/script.h" #include "util.h" +#include "utilstrencodings.h" #include <boost/foreach.hpp> @@ -14,6 +15,8 @@ using namespace std; typedef vector<unsigned char> valtype; +CScriptID::CScriptID(const CScript& in) : uint160(in.size() ? Hash160(in.begin(), in.end()) : 0) {} + const char* GetTxnOutputType(txnouttype t) { switch (t) @@ -280,13 +283,13 @@ public: bool operator()(const CKeyID &keyID) const { script->clear(); - *script << OP_DUP << OP_HASH160 << keyID << OP_EQUALVERIFY << OP_CHECKSIG; + *script << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG; return true; } bool operator()(const CScriptID &scriptID) const { script->clear(); - *script << OP_HASH160 << scriptID << OP_EQUAL; + *script << OP_HASH160 << ToByteVector(scriptID) << OP_EQUAL; return true; } }; @@ -306,7 +309,7 @@ CScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys) script << CScript::EncodeOP_N(nRequired); BOOST_FOREACH(const CPubKey& key, keys) - script << key; + script << ToByteVector(key); script << CScript::EncodeOP_N(keys.size()) << OP_CHECKMULTISIG; return script; } |