Changeset View
Changeset View
Standalone View
Standalone View
src/script/standard.cpp
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | bool Solver(const CScript &scriptPubKey, txnouttype &typeRet, | ||||
static std::multimap<txnouttype, CScript> mTemplates; | static std::multimap<txnouttype, CScript> mTemplates; | ||||
if (mTemplates.empty()) { | if (mTemplates.empty()) { | ||||
// Standard tx, sender provides pubkey, receiver adds signature | // Standard tx, sender provides pubkey, receiver adds signature | ||||
mTemplates.insert( | mTemplates.insert( | ||||
std::make_pair(TX_PUBKEY, CScript() << OP_PUBKEY << OP_CHECKSIG)); | std::make_pair(TX_PUBKEY, CScript() << OP_PUBKEY << OP_CHECKSIG)); | ||||
// Bitcoin address tx, sender provides hash of pubkey, receiver provides | // Bitcoin address tx, sender provides hash of pubkey, receiver provides | ||||
// signature and pubkey | // signature and pubkey | ||||
mTemplates.insert( | mTemplates.insert(std::make_pair( | ||||
std::make_pair(TX_PUBKEYHASH, | TX_PUBKEYHASH, CScript() << OP_DUP << OP_HASH160 << OP_PUBKEYHASH | ||||
CScript() << OP_DUP << OP_HASH160 << OP_PUBKEYHASH | |||||
<< OP_EQUALVERIFY << OP_CHECKSIG)); | << OP_EQUALVERIFY << OP_CHECKSIG)); | ||||
// Sender provides N pubkeys, receivers provides M signatures | // Sender provides N pubkeys, receivers provides M signatures | ||||
mTemplates.insert( | mTemplates.insert(std::make_pair( | ||||
std::make_pair(TX_MULTISIG, | TX_MULTISIG, CScript() << OP_SMALLINTEGER << OP_PUBKEYS | ||||
CScript() << OP_SMALLINTEGER << OP_PUBKEYS | |||||
<< OP_SMALLINTEGER << OP_CHECKMULTISIG)); | << OP_SMALLINTEGER << OP_CHECKMULTISIG)); | ||||
} | } | ||||
vSolutionsRet.clear(); | vSolutionsRet.clear(); | ||||
// Shortcut for pay-to-script-hash, which are more constrained than the | // Shortcut for pay-to-script-hash, which are more constrained than the | ||||
// other types: | // other types: | ||||
// it is always OP_HASH160 20 [20 byte hash] OP_EQUAL | // it is always OP_HASH160 20 [20 byte hash] OP_EQUAL | ||||
if (scriptPubKey.IsPayToScriptHash()) { | if (scriptPubKey.IsPayToScriptHash()) { | ||||
▲ Show 20 Lines • Show All 221 Lines • Show Last 20 Lines |