Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
+ Collaboration diagram for CScript:

Public Member Functions

 CScript ()
 
 CScript (const CScript &b)
 
 CScript (const_iterator pbegin, const_iterator pend)
 
 CScript (const unsigned char *pbegin, const unsigned char *pend)
 
CScriptoperator+= (const CScript &b)
 
 CScript (int64_t b)
 
 CScript (opcodetype b)
 
 CScript (const uint256 &b)
 
 CScript (const CScriptNum &b)
 
 CScript (const std::vector< unsigned char > &b)
 
CScriptoperator<< (int64_t b)
 
CScriptoperator<< (opcodetype opcode)
 
CScriptoperator<< (const uint160 &b)
 
CScriptoperator<< (const uint256 &b)
 
CScriptoperator<< (const CPubKey &key)
 
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
 
unsigned int GetSigOpCount (const CScript &scriptSig) const
 
bool IsPayToScriptHash () const
 
bool IsPushOnly () const
 
bool HasCanonicalPushes () const
 
bool IsUnspendable () const
 
void SetDestination (const CTxDestination &address)
 
void SetMultisig (int nRequired, const std::vector< CPubKey > &keys)
 
void PrintHex () const
 
std::string ToString () const
 
void print () const
 
CScriptID GetID () const
 
std::string mscore_parse (std::vector< std::string > &msc_parsed, bool bNoBypass=true) const
 
std::string mscore_getHex () const
 

Static Public Member Functions

static int DecodeOP_N (opcodetype opcode)
 
static opcodetype EncodeOP_N (int n)
 

Protected Member Functions

CScriptpush_int64 (int64_t n)
 

Friends

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

Detailed Description

Serialized script, used inside transaction inputs and outputs.

Definition at line 401 of file script.h.

Constructor & Destructor Documentation

CScript::CScript ( )
inline

Definition at line 417 of file script.h.

CScript::CScript ( const CScript b)
inline

Definition at line 418 of file script.h.

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

Definition at line 419 of file script.h.

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

Definition at line 421 of file script.h.

CScript::CScript ( int64_t  b)
inline

Definition at line 438 of file script.h.

References operator<<().

+ Here is the call graph for this function:

CScript::CScript ( opcodetype  b)
inlineexplicit

Definition at line 440 of file script.h.

References operator<<().

+ Here is the call graph for this function:

CScript::CScript ( const uint256 b)
inlineexplicit

Definition at line 441 of file script.h.

References operator<<().

+ Here is the call graph for this function:

CScript::CScript ( const CScriptNum b)
inlineexplicit

Definition at line 442 of file script.h.

References operator<<().

+ Here is the call graph for this function:

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

Definition at line 443 of file script.h.

References operator<<().

+ Here is the call graph for this function:

Member Function Documentation

static int CScript::DecodeOP_N ( opcodetype  opcode)
inlinestatic

Definition at line 601 of file script.h.

References OP_0, OP_1, and OP_16.

Referenced by Solver().

+ Here is the caller graph for this function:

static opcodetype CScript::EncodeOP_N ( int  n)
inlinestatic

Definition at line 608 of file script.h.

References OP_0, and OP_1.

int CScript::Find ( opcodetype  op) const
inline

Definition at line 634 of file script.h.

References GetOp().

+ Here is the call graph for this function:

int CScript::FindAndDelete ( const CScript b)
inline

Definition at line 616 of file script.h.

References GetOp().

Referenced by EvalScript().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

CScriptID CScript::GetID ( ) const
inline

Definition at line 708 of file script.h.

References Hash160().

Referenced by CBasicKeyStore::AddCScript(), addmultisigaddress(), createmultisig(), decodescript(), and CWallet::LoadCScript().

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

References GetOp2().

Referenced by EvalScript(), Find(), FindAndDelete(), GetSigOpCount(), CBloomFilter::IsRelevantAndUpdate(), Solver(), and ToString().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 529 of file script.h.

References GetOp2().

+ Here is the call graph for this function:

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

Definition at line 537 of file script.h.

References GetOp2().

+ Here is the call graph for this function:

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

Definition at line 542 of file script.h.

References GetOp2().

+ Here is the call graph for this function:

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

Definition at line 547 of file script.h.

References memcpy(), OP_INVALIDOPCODE, OP_PUSHDATA1, OP_PUSHDATA2, and OP_PUSHDATA4.

Referenced by GetOp().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int CScript::GetSigOpCount ( bool  fAccurate) const

Definition at line 1798 of file script.cpp.

References OP_1, OP_16, OP_CHECKMULTISIG, OP_CHECKMULTISIGVERIFY, OP_CHECKSIG, OP_CHECKSIGVERIFY, and OP_INVALIDOPCODE.

Referenced by GetLegacySigOpCount(), GetP2SHSigOpCount(), and GetSigOpCount().

+ Here is the caller graph for this function:

unsigned int CScript::GetSigOpCount ( const CScript scriptSig) const

... and return its opcount:

Definition at line 1822 of file script.cpp.

References Checkpoints::data, GetOp(), GetSigOpCount(), and OP_16.

+ Here is the call graph for this function:

bool CScript::HasCanonicalPushes ( ) const

Definition at line 1873 of file script.cpp.

References Checkpoints::data, OP_0, OP_16, OP_PUSHDATA1, OP_PUSHDATA2, and OP_PUSHDATA4.

Referenced by IsStandardTx().

+ Here is the caller graph for this function:

bool CScript::IsPayToScriptHash ( ) const

Definition at line 1846 of file script.cpp.

References OP_EQUAL, and OP_HASH160.

Referenced by GetP2SHSigOpCount(), Solver(), and VerifyScript().

+ Here is the caller graph for this function:

bool CScript::IsPushOnly ( ) const

Definition at line 1855 of file script.cpp.

References OP_16.

Referenced by IsStandardTx(), and VerifyScript().

+ Here is the caller graph for this function:

bool CScript::IsUnspendable ( ) const
inline

Definition at line 666 of file script.h.

References OP_RETURN.

Referenced by CCoins::ClearUnspendable().

+ Here is the caller graph for this function:

std::string CScript::mscore_getHex ( ) const
inline

Definition at line 714 of file script.h.

References HexStr().

+ Here is the call graph for this function:

std::string CScript::mscore_parse ( std::vector< std::string > &  msc_parsed,
bool  bNoBypass = true 
) const

Definition at line 3957 of file mastercore.cpp.

References GetOpName(), OP_PUSHDATA4, and ValueString().

+ Here is the call graph for this function:

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

Definition at line 424 of file script.h.

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

Definition at line 446 of file script.h.

References push_int64().

Referenced by CScript().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 448 of file script.h.

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

Definition at line 456 of file script.h.

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

Definition at line 463 of file script.h.

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

Definition at line 470 of file script.h.

References CPubKey::begin(), CPubKey::end(), OP_PUSHDATA1, and CPubKey::size().

+ Here is the call graph for this function:

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

Definition at line 478 of file script.h.

References CScriptNum::getvch().

+ Here is the call graph for this function:

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

Definition at line 484 of file script.h.

References OP_PUSHDATA1, OP_PUSHDATA2, and OP_PUSHDATA4.

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

Definition at line 511 of file script.h.

void CScript::print ( ) const
inline

Definition at line 703 of file script.h.

References LogPrintf, and ToString().

+ Here is the call graph for this function:

void CScript::PrintHex ( ) const
inline

Definition at line 675 of file script.h.

References HexStr(), and LogPrintf.

+ Here is the call graph for this function:

CScript& CScript::push_int64 ( int64_t  n)
inlineprotected

Definition at line 404 of file script.h.

References OP_1, and CScriptNum::serialize().

Referenced by operator<<().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CScript::SetDestination ( const CTxDestination address)

Definition at line 1925 of file script.cpp.

Referenced by mastercore::ClassB_send(), createrawtransaction(), PaymentServer::fetchPaymentACK(), GetAccountAddress(), getreceivedbyaddress(), GUIUtil::isDust(), WalletModel::prepareTransaction(), sendmany(), and CWallet::SendMoneyToDestination().

+ Here is the caller graph for this function:

void CScript::SetMultisig ( int  nRequired,
const std::vector< CPubKey > &  keys 
)

Definition at line 1930 of file script.cpp.

References OP_CHECKMULTISIG.

Referenced by _createmultisig_redeemScript(), and mastercore::ClassB_send().

+ Here is the caller graph for this function:

std::string CScript::ToString ( ) const
inline

Definition at line 680 of file script.h.

References GetOp(), GetOpName(), OP_PUSHDATA4, and ValueString().

Referenced by print(), ScriptPubKeyToJSON(), CTxIn::ToString(), CTxOut::ToString(), and TxToJSON().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Friends And Related Function Documentation

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

Definition at line 430 of file script.h.


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