| 273 | namespace |
| 274 | { |
| 275 | class CScriptVisitor : public boost::static_visitor<bool> |
| 276 | { |
| 277 | private: |
| 278 | CScript *script; |
| 279 | public: |
| 280 | CScriptVisitor(CScript *scriptin) { script = scriptin; } |
| 281 | |
| 282 | bool operator()(const CNoDestination &dest) const { |
| 283 | script->clear(); |
| 284 | return false; |
| 285 | } |
| 286 | |
| 287 | bool operator()(const CKeyID &keyID) const { |
| 288 | script->clear(); |
| 289 | *script << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG; |
| 290 | return true; |
| 291 | } |
| 292 | |
| 293 | bool operator()(const CScriptID &scriptID) const { |
| 294 | script->clear(); |
| 295 | *script << OP_HASH160 << ToByteVector(scriptID) << OP_EQUAL; |
| 296 | return true; |
| 297 | } |
| 298 | }; |
| 299 | } |
| 300 | |
| 301 | CScript GetScriptForDestination(const CTxDestination& dest) |
no outgoing calls
no test coverage detected