Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
CScript Class Reference

Serialized script, used inside transaction inputs and outputs. More...

#include <script.h>

Inheritance diagram for CScript:
[legend]
Collaboration diagram for CScript:
[legend]

Public Member Functions

 CScript ()
 
 CScript (const_iterator pbegin, const_iterator pend)
 
 CScript (std::vector< uint8_t >::const_iterator pbegin, std::vector< uint8_t >::const_iterator pend)
 
 CScript (const uint8_t *pbegin, const uint8_t *pend)
 
 SERIALIZE_METHODS (CScript, obj)
 
 CScript (int64_t b)
 
 CScript (opcodetype b)
 
 CScript (const CScriptNum &b)
 
 CScript (const std::vector< uint8_t > &b)=delete
 
CScriptoperator<< (const CScript &b)=delete
 Delete non-existent operator to defend against future introduction.
 
CScriptoperator<< (int64_t b) LIFETIMEBOUND
 
CScriptoperator<< (opcodetype opcode) LIFETIMEBOUND
 
CScriptoperator<< (const CScriptNum &b) LIFETIMEBOUND
 
CScriptoperator<< (const std::vector< uint8_t > &b) LIFETIMEBOUND
 
bool GetOp (const_iterator &pc, opcodetype &opcodeRet, std::vector< uint8_t > &vchRet) const
 
bool GetOp (const_iterator &pc, opcodetype &opcodeRet) const
 
bool IsPayToScriptHash () const
 
bool IsWitnessProgram (int &version, std::vector< uint8_t > &program) const
 
bool IsWitnessProgram () const
 
bool IsPushOnly (const_iterator pc) const
 Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical).
 
bool IsPushOnly () const
 
bool HasValidOps () const
 Check if the script contains valid OP_CODES.
 
bool IsUnspendable () const
 Returns whether the script is guaranteed to fail at execution, regardless of the initial stack.
 
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)
 
template<typename InputIterator >
 prevector (InputIterator first, InputIterator last)
 
 prevector (const prevector< N, T, Size, Diff > &other)
 
 prevector (prevector< N, T, Size, Diff > &&other) noexcept
 
prevectoroperator= (const prevector< N, T, Size, Diff > &other)
 
prevectoroperator= (prevector< N, T, Size, Diff > &&other) noexcept
 
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)
 
template<typename... Args>
void emplace_back (Args &&...args)
 
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) noexcept
 
 ~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_typedata ()
 
const value_typedata () const
 

Static Public Member Functions

static int DecodeOP_N (opcodetype opcode)
 Encode/decode small integers:
 
static opcodetype EncodeOP_N (int n)
 

Protected Member Functions

CScriptpush_int64 (int64_t n)
 

Additional Inherited Members

- Public Types inherited from prevector< N, T, Size, Diff >
typedef Size size_type
 
typedef Diff difference_type
 
typedefvalue_type
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 

Detailed Description

Serialized script, used inside transaction inputs and outputs.

Definition at line 431 of file script.h.

Constructor & Destructor Documentation

◆ CScript() [1/8]

CScript::CScript ( )
inline

Definition at line 445 of file script.h.

◆ CScript() [2/8]

CScript::CScript ( const_iterator  pbegin,
const_iterator  pend 
)
inline

Definition at line 446 of file script.h.

◆ CScript() [3/8]

CScript::CScript ( std::vector< uint8_t >::const_iterator  pbegin,
std::vector< uint8_t >::const_iterator  pend 
)
inline

Definition at line 448 of file script.h.

◆ CScript() [4/8]

CScript::CScript ( const uint8_t pbegin,
const uint8_t pend 
)
inline

Definition at line 451 of file script.h.

◆ CScript() [5/8]

CScript::CScript ( int64_t  b)
inlineexplicit

Definition at line 456 of file script.h.

Here is the call graph for this function:

◆ CScript() [6/8]

CScript::CScript ( opcodetype  b)
inlineexplicit

Definition at line 457 of file script.h.

Here is the call graph for this function:

◆ CScript() [7/8]

CScript::CScript ( const CScriptNum b)
inlineexplicit

Definition at line 458 of file script.h.

Here is the call graph for this function:

◆ CScript() [8/8]

CScript::CScript ( const std::vector< uint8_t > &  b)
explicitdelete

Member Function Documentation

◆ clear()

void CScript::clear ( )
inline

Definition at line 553 of file script.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DecodeOP_N()

static int CScript::DecodeOP_N ( opcodetype  opcode)
inlinestatic

Encode/decode small integers:

Definition at line 512 of file script.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EncodeOP_N()

static opcodetype CScript::EncodeOP_N ( int  n)
inlinestatic

Definition at line 520 of file script.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetOp() [1/2]

bool CScript::GetOp ( const_iterator pc,
opcodetype opcodeRet 
) const
inline

Definition at line 507 of file script.h.

Here is the call graph for this function:

◆ GetOp() [2/2]

bool CScript::GetOp ( const_iterator pc,
opcodetype opcodeRet,
std::vector< uint8_t > &  vchRet 
) const
inline

Definition at line 502 of file script.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasValidOps()

bool CScript::HasValidOps ( ) const

Check if the script contains valid OP_CODES.

Definition at line 480 of file script.cpp.

Here is the call graph for this function:

◆ IsPayToScriptHash()

bool CScript::IsPayToScriptHash ( ) const

Definition at line 373 of file script.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsPushOnly() [1/2]

bool CScript::IsPushOnly ( ) const

Definition at line 422 of file script.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsPushOnly() [2/2]

bool CScript::IsPushOnly ( const_iterator  pc) const

Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical).

Definition at line 404 of file script.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsUnspendable()

bool CScript::IsUnspendable ( ) const
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 548 of file script.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsWitnessProgram() [1/2]

bool CScript::IsWitnessProgram ( ) const

Definition at line 398 of file script.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsWitnessProgram() [2/2]

bool CScript::IsWitnessProgram ( int version,
std::vector< uint8_t > &  program 
) const

Definition at line 381 of file script.cpp.

Here is the call graph for this function:

◆ operator<<() [1/5]

CScript & CScript::operator<< ( const CScript b)
delete

Delete non-existent operator to defend against future introduction.

Here is the caller graph for this function:

◆ operator<<() [2/5]

CScript & CScript::operator<< ( const CScriptNum b)
inline

Definition at line 476 of file script.h.

Here is the call graph for this function:

◆ operator<<() [3/5]

CScript & CScript::operator<< ( const std::vector< uint8_t > &  b)
inline

Definition at line 481 of file script.h.

Here is the call graph for this function:

◆ operator<<() [4/5]

CScript & CScript::operator<< ( int64_t  b)
inline

Definition at line 466 of file script.h.

Here is the call graph for this function:

◆ operator<<() [5/5]

CScript & CScript::operator<< ( opcodetype  opcode)
inline

Definition at line 468 of file script.h.

Here is the call graph for this function:

◆ push_int64()

CScript & CScript::push_int64 ( int64_t  n)
inlineprotected

Definition at line 433 of file script.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SERIALIZE_METHODS()

CScript::SERIALIZE_METHODS ( CScript  ,
obj   
)
inline

Definition at line 454 of file script.h.

Here is the call graph for this function:

The documentation for this class was generated from the following files: