Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Public Attributes | 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)
 
template<typename Stream , typename Operation >
void SerializationOp (Stream &s, Operation ser_action)
 
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)
 
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, Fabcoin 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 IsPayToScriptHash () const
 
bool IsPayToPubkey () const
 
bool IsPayToPubkeyHash () const
 
bool IsPayToWitnessScriptHash () const
 
bool IsWitnessProgram (int &version, std::vector< unsigned char > &program) const
 
bool IsPushOnly (const_iterator pc) const
 Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). More...
 
bool IsPushOnly () const
 
bool HasValidOps () const
 Check if the script contains valid OP_CODES. More...
 
bool IsUnspendable () const
 Returns whether the script is guaranteed to fail at execution, regardless of the initial stack. More...
 
bool HasOpCreate () const
 
bool HasOpCall () const
 
bool HasOpSpend () const
 
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)
 
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)
 
iterator erase (iterator pos)
 
iterator erase (iterator first, iterator last)
 
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)
 

Public Attributes

 ADD_SERIALIZE_METHODS
 

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 417 of file script.h.

Constructor & Destructor Documentation

CScript::CScript ( )
inline

Definition at line 437 of file script.h.

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

Definition at line 438 of file script.h.

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

Definition at line 439 of file script.h.

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

Definition at line 440 of file script.h.

CScript::CScript ( int64_t  b)
inline

Definition at line 462 of file script.h.

Here is the call graph for this function:

CScript::CScript ( opcodetype  b)
inlineexplicit

Definition at line 464 of file script.h.

Here is the call graph for this function:

CScript::CScript ( const CScriptNum b)
inlineexplicit

Definition at line 465 of file script.h.

Here is the call graph for this function:

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

Definition at line 466 of file script.h.

Here is the call graph for this function:

Member Function Documentation

void CScript::clear ( )
inline

Definition at line 712 of file script.h.

Here is the call graph for this function:

Here is the caller graph for this function:

static int CScript::DecodeOP_N ( opcodetype  opcode)
inlinestatic

Encode/decode small integers:

Definition at line 603 of file script.h.

Here is the call graph for this function:

Here is the caller graph for this function:

static opcodetype CScript::EncodeOP_N ( int  n)
inlinestatic

Definition at line 610 of file script.h.

Here is the call graph for this function:

Here is the caller graph for this function:

int CScript::Find ( opcodetype  op) const
inline

Definition at line 645 of file script.h.

Here is the call graph for this function:

int CScript::FindAndDelete ( const CScript b)
inline

Definition at line 618 of file script.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 523 of file script.h.

Here is the caller graph for this function:

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

Definition at line 532 of file script.h.

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

Definition at line 540 of file script.h.

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

Definition at line 545 of file script.h.

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

Definition at line 550 of file script.h.

Here is the caller graph for this function:

unsigned int CScript::GetSigOpCount ( bool  fAccurate) const

Pre-version-0.6, Fabcoin 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 159 of file script.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

bool CScript::HasOpCall ( ) const
inline

Definition at line 702 of file script.h.

Here is the caller graph for this function:

bool CScript::HasOpCreate ( ) const
inline

Definition at line 697 of file script.h.

Here is the caller graph for this function:

bool CScript::HasOpSpend ( ) const
inline

Definition at line 706 of file script.h.

Here is the caller graph for this function:

bool CScript::HasValidOps ( ) const

Check if the script contains valid OP_CODES.

Definition at line 302 of file script.cpp.

Here is the call graph for this function:

bool CScript::IsPayToPubkey ( ) const

Definition at line 218 of file script.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CScript::IsPayToPubkeyHash ( ) const

Definition at line 231 of file script.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CScript::IsPayToScriptHash ( ) const

Definition at line 207 of file script.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CScript::IsPayToWitnessScriptHash ( ) const

Definition at line 242 of file script.cpp.

Here is the call graph for this function:

bool CScript::IsPushOnly ( const_iterator  pc) const

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

Definition at line 268 of file script.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CScript::IsPushOnly ( ) const

Definition at line 285 of file script.cpp.

Here is the call graph for this function:

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 690 of file script.h.

Here is the caller graph for this function:

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

Definition at line 252 of file script.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 449 of file script.h.

Here is the call graph for this function:

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

Definition at line 469 of file script.h.

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

Definition at line 471 of file script.h.

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

Definition at line 479 of file script.h.

Here is the call graph for this function:

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

Definition at line 485 of file script.h.

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

Definition at line 514 of file script.h.

Here is the call graph for this function:

CScript& CScript::push_int64 ( int64_t  n)
inlineprotected

Definition at line 420 of file script.h.

Here is the call graph for this function:

template<typename Stream , typename Operation >
void CScript::SerializationOp ( Stream &  s,
Operation  ser_action 
)
inline

Definition at line 445 of file script.h.

Friends And Related Function Documentation

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

Definition at line 455 of file script.h.

Member Data Documentation

CScript::ADD_SERIALIZE_METHODS

Definition at line 442 of file script.h.


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