diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-17 12:08:53 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-17 13:04:54 +0200 |
commit | 69dd8c919aa3a1b88af34265f828fe0a58a55014 (patch) | |
tree | 672551d1afcb67ad45a24450ac753cfbd31d2e1e /src/script/script.cpp | |
parent | 651a1fcf813983e8e5f6f180e062a5111e900dad (diff) | |
parent | 0be990ba34110184c8a5a2c04094311dab5cd84c (diff) |
Merge pull request #4899
0be990b Move CTxDestination from script/script to script/standard (Pieter Wuille)
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; -} |