Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Serialized script, used inside transaction inputs and outputs. More...
#include <script.h>
Public Member Functions | |
CScript () | |
CScript (const_iterator pbegin, const_iterator pend) | |
CScript (std::vector< unsigned char >::const_iterator pbegin, std::vector< unsigned char >::const_iterator pend) | |
CScript (const unsigned char *pbegin, const unsigned char *pend) | |
template<typename Stream , typename Operation > | |
void | SerializationOp (Stream &s, Operation ser_action) |
CScript & | operator+= (const CScript &b) |
CScript (int64_t b) | |
CScript (opcodetype b) | |
CScript (const CScriptNum &b) | |
CScript (const std::vector< unsigned char > &b) | |
CScript & | operator<< (int64_t b) |
CScript & | operator<< (opcodetype opcode) |
CScript & | operator<< (const CScriptNum &b) |
CScript & | operator<< (const std::vector< unsigned char > &b) |
CScript & | operator<< (const CScript &b) |
bool | GetOp (iterator &pc, opcodetype &opcodeRet, std::vector< unsigned char > &vchRet) |
bool | GetOp (iterator &pc, opcodetype &opcodeRet) |
bool | GetOp (const_iterator &pc, opcodetype &opcodeRet, std::vector< unsigned char > &vchRet) const |
bool | GetOp (const_iterator &pc, opcodetype &opcodeRet) const |
bool | GetOp2 (const_iterator &pc, opcodetype &opcodeRet, std::vector< unsigned char > *pvchRet) const |
int | FindAndDelete (const CScript &b) |
int | Find (opcodetype op) const |
unsigned int | GetSigOpCount (bool fAccurate) const |
Pre-version-0.6, Bitcoin always counted CHECKMULTISIGs as 20 sigops. More... | |
unsigned int | GetSigOpCount (const CScript &scriptSig) const |
Accurately count sigOps, including sigOps in pay-to-script-hash transactions: More... | |
bool | IsPayToPublicKeyHash () const |
bool | IsPayToScriptHash () const |
bool | IsPayToPublicKey () const |
Used for obsolete pay-to-pubkey addresses indexing. More... | |
bool | IsPushOnly (const_iterator pc) const |
Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). More... | |
bool | IsPushOnly () const |
bool | IsUnspendable () const |
Returns whether the script is guaranteed to fail at execution, regardless of the initial stack. More... | |
void | clear () |
Public Member Functions inherited from prevector< N, T, Size, Diff > | |
void | assign (size_type n, const T &val) |
template<typename InputIterator > | |
void | assign (InputIterator first, InputIterator last) |
prevector () | |
prevector (size_type n) | |
prevector (size_type n, const T &val=T()) | |
template<typename InputIterator > | |
prevector (InputIterator first, InputIterator last) | |
prevector (const prevector< N, T, Size, Diff > &other) | |
prevector (prevector< N, T, Size, Diff > &&other) | |
prevector & | operator= (const prevector< N, T, Size, Diff > &other) |
prevector & | operator= (prevector< N, T, Size, Diff > &&other) |
size_type | size () const |
bool | empty () const |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
size_t | capacity () const |
T & | operator[] (size_type pos) |
const T & | operator[] (size_type pos) const |
void | resize (size_type new_size) |
void | reserve (size_type new_capacity) |
void | shrink_to_fit () |
void | clear () |
iterator | insert (iterator pos, const T &value) |
void | insert (iterator pos, size_type count, const T &value) |
template<typename InputIterator > | |
void | insert (iterator pos, InputIterator first, InputIterator last) |
void | resize_uninitialized (size_type new_size) |
iterator | erase (iterator pos) |
iterator | erase (iterator first, iterator last) |
void | push_back (const T &value) |
void | pop_back () |
T & | front () |
const T & | front () const |
T & | back () |
const T & | back () const |
void | swap (prevector< N, T, Size, Diff > &other) |
~prevector () | |
bool | operator== (const prevector< N, T, Size, Diff > &other) const |
bool | operator!= (const prevector< N, T, Size, Diff > &other) const |
bool | operator< (const prevector< N, T, Size, Diff > &other) const |
size_t | allocated_memory () const |
value_type * | data () |
const value_type * | data () const |
Static Public Member Functions | |
static int | DecodeOP_N (opcodetype opcode) |
Encode/decode small integers: More... | |
static opcodetype | EncodeOP_N (int n) |
Static Public Member Functions inherited from prevector< N, T, Size, Diff > | |
template<typename V > | |
static void | assign_to (const_iterator b, const_iterator e, V &v) |
Public Attributes | |
ADD_SERIALIZE_METHODS | |
Protected Member Functions | |
CScript & | push_int64 (int64_t n) |
Friends | |
CScript | operator+ (const CScript &a, const CScript &b) |
Additional Inherited Members | |
Public Types inherited from prevector< N, T, Size, Diff > | |
typedef Size | size_type |
typedef Diff | difference_type |
typedef T | value_type |
typedef value_type & | reference |
typedef const value_type & | const_reference |
typedef value_type * | pointer |
typedef const value_type * | const_pointer |
Detailed Description
Serialized script, used inside transaction inputs and outputs.
Constructor & Destructor Documentation
◆ CScript() [1/8]
◆ CScript() [2/8]
|
inline |
◆ CScript() [3/8]
|
inline |
◆ CScript() [4/8]
|
inline |
◆ CScript() [5/8]
|
inline |
Definition at line 435 of file script.h.
References operator<<().
◆ CScript() [6/8]
|
inlineexplicit |
Definition at line 437 of file script.h.
References operator<<().
◆ CScript() [7/8]
|
inlineexplicit |
Definition at line 438 of file script.h.
References operator<<().
◆ CScript() [8/8]
|
inlineexplicit |
Definition at line 439 of file script.h.
References operator<<().
Member Function Documentation
◆ clear()
|
inline |
Definition at line 664 of file script.h.
References prevector< N, T, Size, Diff >::clear(), and prevector< N, T, Size, Diff >::shrink_to_fit().
Referenced by CTxOut::SetNull(), CAddressUnspentValue::SetNull(), and Solver().
◆ DecodeOP_N()
|
inlinestatic |
◆ EncodeOP_N()
|
inlinestatic |
◆ Find()
|
inline |
Definition at line 618 of file script.h.
References prevector< N, T, Size, Diff >::begin(), prevector< N, T, Size, Diff >::end(), and GetOp().
◆ FindAndDelete()
|
inline |
Definition at line 591 of file script.h.
References prevector< N, T, Size, Diff >::begin(), prevector< N, T, Size, Diff >::empty(), prevector< N, T, Size, Diff >::end(), GetOp(), prevector< N, T, Size, Diff >::insert(), and prevector< N, T, Size, Diff >::size().
Referenced by EvalScript().
◆ GetOp() [1/4]
|
inline |
Definition at line 496 of file script.h.
References prevector< N, T, Size, Diff >::begin(), and GetOp2().
Referenced by CBloomFilter::CheckScript(), EvalScript(), ExtractPubKey(), Find(), FindAndDelete(), GetSigOpCount(), IsPushOnly(), ScriptToAsmStr(), and Solver().
◆ GetOp() [2/4]
|
inline |
Definition at line 505 of file script.h.
References prevector< N, T, Size, Diff >::begin(), and GetOp2().
◆ GetOp() [3/4]
|
inline |
◆ GetOp() [4/4]
|
inline |
◆ GetOp2()
|
inline |
Definition at line 523 of file script.h.
References prevector< N, T, Size, Diff >::assign_to(), prevector< N, T, Size, Diff >::end(), OP_INVALIDOPCODE, OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4, ReadLE16(), and ReadLE32().
Referenced by FormatScript(), and GetOp().
◆ GetSigOpCount() [1/2]
unsigned int CScript::GetSigOpCount | ( | bool | fAccurate | ) | const |
Pre-version-0.6, Bitcoin always counted CHECKMULTISIGs as 20 sigops.
With pay-to-script-hash, that changed: CHECKMULTISIGs serialized in scriptSigs are counted more accurately, assuming they are of the form ... OP_N CHECKMULTISIG ...
Definition at line 153 of file script.cpp.
References prevector< N, T, Size, Diff >::begin(), DecodeOP_N(), prevector< N, T, Size, Diff >::end(), GetOp(), MAX_PUBKEYS_PER_MULTISIG, OP_1, OP_16, OP_CHECKMULTISIG, OP_CHECKMULTISIGVERIFY, OP_CHECKSIG, OP_CHECKSIGVERIFY, and OP_INVALIDOPCODE.
Referenced by GetP2SHSigOpCount(), and GetSigOpCount().
◆ GetSigOpCount() [2/2]
unsigned int CScript::GetSigOpCount | ( | const CScript & | scriptSig | ) | const |
Accurately count sigOps, including sigOps in pay-to-script-hash transactions:
... and return its opcount:
Definition at line 177 of file script.cpp.
References prevector< N, T, Size, Diff >::begin(), prevector< N, T, Size, Diff >::end(), GetOp(), GetSigOpCount(), IsPayToScriptHash(), and OP_16.
◆ IsPayToPublicKey()
bool CScript::IsPayToPublicKey | ( | ) | const |
Used for obsolete pay-to-pubkey addresses indexing.
Definition at line 221 of file script.cpp.
References OP_CHECKSIG, and prevector< N, T, Size, Diff >::size().
Referenced by CTxMemPool::addAddressIndex(), CTxMemPool::addSpentIndex(), CChainState::ConnectBlock(), and CChainState::DisconnectBlock().
◆ IsPayToPublicKeyHash()
bool CScript::IsPayToPublicKeyHash | ( | ) | const |
Definition at line 201 of file script.cpp.
References OP_CHECKSIG, OP_DUP, OP_EQUALVERIFY, OP_HASH160, and prevector< N, T, Size, Diff >::size().
Referenced by CTxMemPool::addAddressIndex(), CTxMemPool::addSpentIndex(), CheckProRegTx(), CheckProUpRegTx(), CheckProUpServTx(), CChainState::ConnectBlock(), and CChainState::DisconnectBlock().
◆ IsPayToScriptHash()
bool CScript::IsPayToScriptHash | ( | ) | const |
Definition at line 212 of file script.cpp.
References OP_EQUAL, OP_HASH160, and prevector< N, T, Size, Diff >::size().
Referenced by CTxMemPool::addAddressIndex(), CTxMemPool::addSpentIndex(), CheckProRegTx(), CheckProUpRegTx(), CheckProUpServTx(), CChainState::ConnectBlock(), CChainState::DisconnectBlock(), GetSigOpCount(), listunspent(), ProcessImport(), Solver(), and VerifyScript().
◆ IsPushOnly() [1/2]
bool CScript::IsPushOnly | ( | const_iterator | pc | ) | const |
Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical).
Definition at line 236 of file script.cpp.
References prevector< N, T, Size, Diff >::end(), GetOp(), and OP_16.
Referenced by IsStandardTx(), Solver(), and VerifyScript().
◆ IsPushOnly() [2/2]
bool CScript::IsPushOnly | ( | ) | const |
Definition at line 253 of file script.cpp.
References prevector< N, T, Size, Diff >::begin().
◆ IsUnspendable()
|
inline |
Returns whether the script is guaranteed to fail at execution, regardless of the initial stack.
This allows outputs to be pruned instantly when entering the UTXO set.
Definition at line 659 of file script.h.
References prevector< N, T, Size, Diff >::begin(), MAX_SCRIPT_SIZE, OP_RETURN, and prevector< N, T, Size, Diff >::size().
Referenced by CWallet::GetAccountName(), CWalletTx::GetAmounts(), GetDustThreshold(), and ScriptToAsmStr().
◆ operator+=()
Definition at line 421 of file script.h.
References prevector< N, T, Size, Diff >::begin(), prevector< N, T, Size, Diff >::end(), prevector< N, T, Size, Diff >::insert(), prevector< N, T, Size, Diff >::reserve(), and prevector< N, T, Size, Diff >::size().
◆ operator<<() [1/5]
|
inline |
◆ operator<<() [2/5]
|
inline |
Definition at line 444 of file script.h.
References prevector< N, T, Size, Diff >::end(), and prevector< N, T, Size, Diff >::insert().
◆ operator<<() [3/5]
|
inline |
Definition at line 452 of file script.h.
References CScriptNum::getvch().
◆ operator<<() [4/5]
|
inline |
Definition at line 458 of file script.h.
References prevector< N, T, Size, Diff >::end(), prevector< N, T, Size, Diff >::insert(), OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4, WriteLE16(), and WriteLE32().
◆ operator<<() [5/5]
◆ push_int64()
|
inlineprotected |
Definition at line 392 of file script.h.
References OP_0, OP_1, prevector< N, T, Size, Diff >::push_back(), and CScriptNum::serialize().
Referenced by operator<<().
◆ SerializationOp()
|
inline |
Friends And Related Function Documentation
◆ operator+
Member Data Documentation
◆ ADD_SERIALIZE_METHODS
The documentation for this class was generated from the following files:
- src/script/script.h
- src/script/script.cpp