Changeset View
Changeset View
Standalone View
Standalone View
src/script/standard.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_SCRIPT_STANDARD_H | #ifndef BITCOIN_SCRIPT_STANDARD_H | ||||
#define BITCOIN_SCRIPT_STANDARD_H | #define BITCOIN_SCRIPT_STANDARD_H | ||||
#include <amount.h> | #include <amount.h> | ||||
#include <pubkey.h> | #include <pubkey.h> | ||||
#include <script/script_flags.h> | #include <script/script_flags.h> | ||||
#include <uint256.h> | #include <uint256.h> | ||||
#include <boost/variant.hpp> | #include <boost/variant.hpp> | ||||
#include <string> | |||||
static const bool DEFAULT_ACCEPT_DATACARRIER = true; | static const bool DEFAULT_ACCEPT_DATACARRIER = true; | ||||
class CKeyID; | class CKeyID; | ||||
class CScript; | class CScript; | ||||
/** A reference to a CScript: the Hash160 of its serialization (see script.h) */ | /** A reference to a CScript: the Hash160 of its serialization (see script.h) */ | ||||
class CScriptID : public uint160 { | class CScriptID : public uint160 { | ||||
public: | public: | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
* A CTxDestination is the internal data type encoded in a bitcoin address | * A CTxDestination is the internal data type encoded in a bitcoin address | ||||
*/ | */ | ||||
typedef boost::variant<CNoDestination, PKHash, ScriptHash> CTxDestination; | typedef boost::variant<CNoDestination, PKHash, ScriptHash> CTxDestination; | ||||
/** Check whether a CTxDestination is a CNoDestination. */ | /** Check whether a CTxDestination is a CNoDestination. */ | ||||
bool IsValidDestination(const CTxDestination &dest); | bool IsValidDestination(const CTxDestination &dest); | ||||
/** Get the name of a txnouttype as a C string, or nullptr if unknown. */ | /** Get the name of a txnouttype as a C string, or nullptr if unknown. */ | ||||
const char *GetTxnOutputType(txnouttype t); | std::string GetTxnOutputType(txnouttype t); | ||||
/** | /** | ||||
* 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 | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |