diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2014-09-11 19:15:29 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2014-09-16 19:14:32 +0200 |
commit | 0be990ba34110184c8a5a2c04094311dab5cd84c (patch) | |
tree | 2eb24931c396ae0dc0c57fee42f345c581bd58c6 /src/script/script.cpp | |
parent | ab3834baae2e48708de2be74217eaf9da9081fc3 (diff) |
Move CTxDestination from script/script to script/standard
Diffstat (limited to 'src/script/script.cpp')
-rw-r--r-- | src/script/script.cpp | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/script/script.cpp b/src/script/script.cpp index 3c9f38dc8b..a5126e7cc2 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -253,43 +253,3 @@ bool CScript::HasCanonicalPushes() const } return true; } - -class CScriptVisitor : public boost::static_visitor<bool> -{ -private: - CScript *script; -public: - CScriptVisitor(CScript *scriptin) { script = scriptin; } - - bool operator()(const CNoDestination &dest) const { - script->clear(); - return false; - } - - bool operator()(const CKeyID &keyID) const { - script->clear(); - *script << OP_DUP << OP_HASH160 << keyID << OP_EQUALVERIFY << OP_CHECKSIG; - return true; - } - - bool operator()(const CScriptID &scriptID) const { - script->clear(); - *script << OP_HASH160 << scriptID << OP_EQUAL; - return true; - } -}; - -void CScript::SetDestination(const CTxDestination& dest) -{ - boost::apply_visitor(CScriptVisitor(this), dest); -} - -void CScript::SetMultisig(int nRequired, const std::vector<CPubKey>& keys) -{ - this->clear(); - - *this << EncodeOP_N(nRequired); - BOOST_FOREACH(const CPubKey& key, keys) - *this << key; - *this << EncodeOP_N(keys.size()) << OP_CHECKMULTISIG; -} |