PIVX Core  5.6.99
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | 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< unsigned char >::const_iterator pbegin, std::vector< unsigned char >::const_iterator pend)
 
 CScript (const unsigned char *pbegin, const unsigned char *pend)
 
 SERIALIZE_METHODS (CScript, obj)
 
CScriptoperator+= (const CScript &b)
 
 CScript (int64_t b)
 
 CScript (opcodetype b)
 
 CScript (const CScriptNum &b)
 
 CScript (const std::vector< unsigned char > &b)
 
CScriptoperator<< (int64_t b)
 
CScriptoperator<< (opcodetype opcode)
 
CScriptoperator<< (const CScriptNum &b)
 
CScriptoperator<< (const std::vector< unsigned char > &b)
 
CScriptoperator<< (const CScript &b)
 
CScriptoperator<< (const CPubKey &key)
 
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 IsPayToColdStaking () const
 
bool IsPayToColdStakingLOF () const
 
bool IsPayToExchangeAddress () const
 
bool StartsWithOpcode (const opcodetype opcode) const
 
bool IsZerocoinMint () const
 
bool IsZerocoinSpend () const
 
bool IsZerocoinPublicSpend () const
 
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 ()
 
size_t DynamicMemoryUsage () const
 
- 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)
 
prevectoroperator= (const prevector< N, T, Size, Diff > &other)
 
prevectoroperator= (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
 
Toperator[] (size_type pos)
 
const Toperator[] (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 ()
 
Tfront ()
 
const Tfront () const
 
Tback ()
 
const Tback () 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_typedata ()
 
const value_typedata () const
 

Static Public Member Functions

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

Protected Member Functions

CScriptpush_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_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 380 of file script.h.

Constructor & Destructor Documentation

◆ CScript() [1/8]

CScript::CScript ( )
inline

Definition at line 400 of file script.h.

◆ CScript() [2/8]

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

Definition at line 401 of file script.h.

◆ CScript() [3/8]

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

Definition at line 402 of file script.h.

◆ CScript() [4/8]

CScript::CScript ( const unsigned char *  pbegin,
const unsigned char *  pend 
)
inline

Definition at line 403 of file script.h.

◆ CScript() [5/8]

CScript::CScript ( int64_t  b)
inlineexplicit

Definition at line 421 of file script.h.

Here is the call graph for this function:

◆ CScript() [6/8]

CScript::CScript ( opcodetype  b)
inlineexplicit

Definition at line 423 of file script.h.

Here is the call graph for this function:

◆ CScript() [7/8]

CScript::CScript ( const CScriptNum b)
inlineexplicit

Definition at line 424 of file script.h.

Here is the call graph for this function:

◆ CScript() [8/8]

CScript::CScript ( const std::vector< unsigned char > &  b)
inlineexplicit

Definition at line 425 of file script.h.

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void CScript::clear ( )
inline

Definition at line 659 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 568 of file script.h.

Here is the caller graph for this function:

◆ DynamicMemoryUsage()

size_t CScript::DynamicMemoryUsage ( ) const

Definition at line 307 of file script.cpp.

Here is the caller graph for this function:

◆ EncodeOP_N()

static opcodetype CScript::EncodeOP_N ( int  n)
inlinestatic

Definition at line 575 of file script.h.

Here is the caller graph for this function:

◆ Find()

int CScript::Find ( opcodetype  op) const
inline

Definition at line 610 of file script.h.

Here is the call graph for this function:

◆ FindAndDelete()

int CScript::FindAndDelete ( const CScript b)
inline

Definition at line 583 of file script.h.

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

◆ GetOp() [1/4]

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

Definition at line 510 of file script.h.

Here is the call graph for this function:

◆ GetOp() [2/4]

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

Definition at line 505 of file script.h.

Here is the call graph for this function:

◆ GetOp() [3/4]

bool CScript::GetOp ( iterator pc,
opcodetype opcodeRet 
)
inline

Definition at line 497 of file script.h.

Here is the call graph for this function:

◆ GetOp() [4/4]

bool CScript::GetOp ( iterator pc,
opcodetype opcodeRet,
std::vector< unsigned char > &  vchRet 
)
inline

Definition at line 488 of file script.h.

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

◆ GetOp2()

bool CScript::GetOp2 ( const_iterator pc,
opcodetype opcodeRet,
std::vector< unsigned char > *  pvchRet 
) const
inline

Definition at line 515 of file script.h.

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

◆ 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 164 of file script.cpp.

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

◆ 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 188 of file script.cpp.

Here is the call graph for this function:

◆ IsPayToColdStaking()

bool CScript::IsPayToColdStaking ( ) const

Definition at line 233 of file script.cpp.

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

◆ IsPayToColdStakingLOF()

bool CScript::IsPayToColdStakingLOF ( ) const

Definition at line 249 of file script.cpp.

Here is the call graph for this function:

◆ IsPayToExchangeAddress()

bool CScript::IsPayToExchangeAddress ( ) const

Definition at line 254 of file script.cpp.

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

◆ IsPayToPublicKeyHash()

bool CScript::IsPayToPublicKeyHash ( ) const

Definition at line 212 of file script.cpp.

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

◆ IsPayToScriptHash()

bool CScript::IsPayToScriptHash ( ) const

Definition at line 223 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 302 of file script.cpp.

Here is the call 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 285 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 654 of file script.h.

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

◆ IsZerocoinMint()

bool CScript::IsZerocoinMint ( ) const

Definition at line 270 of file script.cpp.

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

◆ IsZerocoinPublicSpend()

bool CScript::IsZerocoinPublicSpend ( ) const

Definition at line 280 of file script.cpp.

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

◆ IsZerocoinSpend()

bool CScript::IsZerocoinSpend ( ) const

Definition at line 275 of file script.cpp.

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

◆ operator+=()

CScript& CScript::operator+= ( const CScript b)
inline

Definition at line 407 of file script.h.

Here is the call graph for this function:

◆ operator<<() [1/6]

CScript& CScript::operator<< ( const CPubKey key)
inline

Definition at line 481 of file script.h.

Here is the call graph for this function:

◆ operator<<() [2/6]

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

Definition at line 473 of file script.h.

◆ operator<<() [3/6]

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

Definition at line 438 of file script.h.

Here is the call graph for this function:

◆ operator<<() [4/6]

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

Definition at line 444 of file script.h.

Here is the call graph for this function:

◆ operator<<() [5/6]

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

Definition at line 428 of file script.h.

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

◆ operator<<() [6/6]

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

Definition at line 430 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 383 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 405 of file script.h.

◆ StartsWithOpcode()

bool CScript::StartsWithOpcode ( const opcodetype  opcode) const

Definition at line 265 of file script.cpp.

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

Friends And Related Function Documentation

◆ operator+

CScript operator+ ( const CScript a,
const CScript b 
)
friend

Definition at line 414 of file script.h.


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