Changeset View
Changeset View
Standalone View
Standalone View
src/script/standard.h
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Parse a scriptPubKey and identify script type for standard scripts. If | * Parse a scriptPubKey and identify script type for standard scripts. If | ||||
* successful, returns script type and parsed pubkeys or hashes, depending on | * successful, returns script type and parsed pubkeys or hashes, depending on | ||||
* the type. For example, for a P2SH script, vSolutionsRet will contain the | * the type. For example, for a P2SH script, vSolutionsRet will contain the | ||||
* script hash, for P2PKH it will contain the key hash, etc. | * script hash, for P2PKH it will contain the key hash, etc. | ||||
* | * | ||||
* @param[in] scriptPubKey Script to parse | * @param[in] scriptPubKey Script to parse | ||||
* @param[out] typeRet The script type | |||||
* @param[out] vSolutionsRet Vector of parsed pubkeys and hashes | * @param[out] vSolutionsRet Vector of parsed pubkeys and hashes | ||||
* @return True if script matches standard template | * @return The script type. TX_NONSTANDARD represents a | ||||
* failed solve. | |||||
*/ | */ | ||||
bool Solver(const CScript &scriptPubKey, txnouttype &typeRet, | txnouttype Solver(const CScript &scriptPubKey, | ||||
std::vector<std::vector<uint8_t>> &vSolutionsRet); | std::vector<std::vector<uint8_t>> &vSolutionsRet); | ||||
/** | /** | ||||
* Parse a standard scriptPubKey for the destination address. Assigns result to | * Parse a standard scriptPubKey for the destination address. Assigns result to | ||||
* the addressRet parameter and returns true if successful. For multisig | * the addressRet parameter and returns true if successful. For multisig | ||||
* scripts, instead use ExtractDestinations. Currently only works for P2PK, | * scripts, instead use ExtractDestinations. Currently only works for P2PK, | ||||
* P2PKH, and P2SH scripts. | * P2PKH, and P2SH scripts. | ||||
*/ | */ | ||||
bool ExtractDestination(const CScript &scriptPubKey, | bool ExtractDestination(const CScript &scriptPubKey, | ||||
Show All 32 Lines |