Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
CMPTransaction Class Reference

#include <mastercore_tx.h>

+ Collaboration diagram for CMPTransaction:

Classes

class  SendToOwners_compare
 

Public Types

enum  ActionTypes {
  INVALID = 0,
  NEW = 1,
  UPDATE = 2,
  CANCEL = 3,
  ADD = 1,
  CANCEL_AT_PRICE = 2,
  CANCEL_ALL_FOR_PAIR = 3,
  CANCEL_EVERYTHING = 4
}
 

Public Member Functions

unsigned int getType () const
 
const string getTypeString () const
 
unsigned int getProperty () const
 
unsigned short getVersion () const
 
unsigned short getPropertyType () const
 
uint64_t getFeePaid () const
 
const string & getSender () const
 
const string & getReceiver () const
 
uint64_t getAmount () const
 
uint64_t getNewAmount () const
 
string getSPName () const
 
void printInfo (FILE *fp)
 
void SetNull ()
 
 CMPTransaction ()
 
int logicMath_SimpleSend (void)
 
int logicMath_TradeOffer (CMPOffer *)
 
int logicMath_AcceptOffer_BTC (void)
 
int logicMath_SendToOwners (FILE *fp=NULL)
 
int logicMath_MetaDEx (CMPMetaDEx *)
 
int logicMath_GrantTokens (void)
 
int logicMath_RevokeTokens (void)
 
int logicMath_ChangeIssuer (void)
 
int logicMath_SavingsMark (void)
 
int logicMath_SavingsCompromised (void)
 
int interpretPacket (CMPOffer *obj_o=NULL, CMPMetaDEx *mdex_o=NULL)
 
int step1 (void)
 
int step2_Alert (std::string *new_global_alert_message)
 
int step2_Value (void)
 
bool isOverrun (const char *p, unsigned int line)
 
const char * step2_SmartProperty (int &error_code)
 
int step3_sp_fixed (const char *p)
 
int step3_sp_variable (const char *p)
 
void Set (const uint256 &t, int b, unsigned int idx, int64_t bt)
 
void Set (string s, string r, uint64_t n, const uint256 &t, int b, unsigned int idx, unsigned char *p, unsigned int size, int fMultisig, uint64_t txf)
 
bool operator< (const CMPTransaction &other) const
 
void print ()
 

Private Attributes

string sender
 
string receiver
 
uint256 txid
 
int block
 
unsigned int tx_idx
 
int pkt_size
 
unsigned char pkt [1+MAX_PACKETS *PACKET_SIZE]
 
uint64_t nValue
 
int multi
 
uint64_t tx_fee_paid
 
unsigned int type
 
unsigned int property
 
unsigned short version
 
uint64_t nNewValue
 
int64_t blockTime
 
unsigned char ecosystem
 
unsigned short prop_type
 
unsigned int prev_prop_id
 
char category [SP_STRING_FIELD_LEN]
 
char subcategory [SP_STRING_FIELD_LEN]
 
char name [SP_STRING_FIELD_LEN]
 
char url [SP_STRING_FIELD_LEN]
 
char data [SP_STRING_FIELD_LEN]
 
uint64_t deadline
 
unsigned char early_bird
 
unsigned char percentage
 
unsigned int desired_property
 
uint64_t desired_value
 

Detailed Description

Definition at line 9 of file mastercore_tx.h.

Member Enumeration Documentation

Enumerator
INVALID 
NEW 
UPDATE 
CANCEL 
ADD 
CANCEL_AT_PRICE 
CANCEL_ALL_FOR_PAIR 
CANCEL_EVERYTHING 

Definition at line 59 of file mastercore_tx.h.

Constructor & Destructor Documentation

CMPTransaction::CMPTransaction ( )
inline

Definition at line 123 of file mastercore_tx.h.

References SetNull().

+ Here is the call graph for this function:

Member Function Documentation

uint64_t CMPTransaction::getAmount ( ) const
inline

Definition at line 87 of file mastercore_tx.h.

References nValue.

Referenced by gettrade_MP(), and populateRPCTransactionObject().

+ Here is the caller graph for this function:

uint64_t CMPTransaction::getFeePaid ( ) const
inline

Definition at line 82 of file mastercore_tx.h.

References tx_fee_paid.

Referenced by populateRPCTransactionObject().

+ Here is the caller graph for this function:

uint64_t CMPTransaction::getNewAmount ( ) const
inline

Definition at line 88 of file mastercore_tx.h.

References nNewValue.

Referenced by mastercore_handler_tx().

+ Here is the caller graph for this function:

unsigned int CMPTransaction::getProperty ( ) const
inline

Definition at line 79 of file mastercore_tx.h.

References property.

Referenced by getsto_MP(), gettrade_MP(), and populateRPCTransactionObject().

+ Here is the caller graph for this function:

unsigned short CMPTransaction::getPropertyType ( ) const
inline

Definition at line 81 of file mastercore_tx.h.

References prop_type.

const string& CMPTransaction::getReceiver ( ) const
inline

Definition at line 85 of file mastercore_tx.h.

References receiver.

Referenced by populateRPCTransactionObject().

+ Here is the caller graph for this function:

const string& CMPTransaction::getSender ( ) const
inline

Definition at line 84 of file mastercore_tx.h.

References sender.

Referenced by gettrade_MP(), and populateRPCTransactionObject().

+ Here is the caller graph for this function:

string CMPTransaction::getSPName ( ) const
inline

Definition at line 90 of file mastercore_tx.h.

Referenced by populateRPCTransactionObject().

+ Here is the caller graph for this function:

unsigned int CMPTransaction::getType ( ) const
inline

Definition at line 77 of file mastercore_tx.h.

References type.

Referenced by getTypeString(), mastercore_handler_tx(), populateRPCTransactionObject(), and CMPTxList::setLastAlert().

+ Here is the caller graph for this function:

const string CMPTransaction::getTypeString ( ) const
inline

Definition at line 78 of file mastercore_tx.h.

References mastercore::c_strMasterProtocolTXType(), and getType().

Referenced by populateRPCTransactionObject().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned short CMPTransaction::getVersion ( ) const
inline

Definition at line 80 of file mastercore_tx.h.

References version.

Referenced by populateRPCTransactionObject().

+ Here is the caller graph for this function:

int CMPTransaction::interpretPacket ( CMPOffer obj_o = NULL,
CMPMetaDEx mdex_o = NULL 
)

Definition at line 4116 of file mastercore.cpp.

References mastercore::_my_sps, BALANCE, mastercore::calculateFractional(), CMPSPInfo::Entry::category, chainActive, CMPSPInfo::Entry::close_early, CMPSPInfo::Entry::creation_block, CMPSPInfo::Entry::data, Checkpoints::data, CMPSPInfo::Entry::deadline, mastercore::dumpCrowdsaleInfo(), CMPSPInfo::Entry::early_bird, CMPSPInfo::Entry::fixed, mastercore::getCrowd(), CMPCrowd::getDatabase(), GetDataDir(), CMPCrowd::getIssuerCreated(), CMPCrowd::getPropertyId(), CMPSPInfo::getSP(), global_alert_message, CMPSPInfo::hasSP(), CMPSPInfo::Entry::historicalData, CMPSPInfo::Entry::issuer, CMPSPInfo::Entry::manual, memcpy(), CMPSPInfo::Entry::missedTokens, MSC_TYPE_ACCEPT_OFFER_BTC, MSC_TYPE_CHANGE_ISSUER_ADDRESS, MSC_TYPE_CLOSE_CROWDSALE, MSC_TYPE_CREATE_PROPERTY_FIXED, MSC_TYPE_CREATE_PROPERTY_MANUAL, MSC_TYPE_CREATE_PROPERTY_VARIABLE, MSC_TYPE_GRANT_PROPERTY_TOKENS, MSC_TYPE_METADEX, MSC_TYPE_REVOKE_PROPERTY_TOKENS, MSC_TYPE_SAVINGS_COMPROMISED, MSC_TYPE_SAVINGS_MARK, MSC_TYPE_SEND_TO_OWNERS, MSC_TYPE_SIMPLE_SEND, MSC_TYPE_TRADE_OFFER, mastercore::my_crowds, CMPSPInfo::Entry::name, CMPSPInfo::Entry::num_tokens, OMNICORE_MESSAGE_TYPE_ALERT, OWNERS_FILENAME, CMPSPInfo::Entry::percentage, PKT_ERROR, PKT_ERROR_SP, CMPSPInfo::Entry::prop_type, CMPSPInfo::Entry::property_desired, CMPSPInfo::putSP(), CMPSPInfo::Entry::subcategory, mastercore::swapByteOrder32(), CMPSPInfo::Entry::timeclosed, CMPSPInfo::Entry::txid, CMPSPInfo::Entry::txid_close, CMPSPInfo::Entry::update_block, mastercore::update_tally_map(), CMPSPInfo::updateSP(), CMPSPInfo::Entry::url, and url.

Referenced by gettrade_MP(), mastercore_handler_tx(), and populateRPCTransactionObject().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CMPTransaction::isOverrun ( const char *  p,
unsigned int  line 
)

Definition at line 176 of file mastercore_tx.cpp.

int CMPTransaction::logicMath_AcceptOffer_BTC ( void  )

Definition at line 477 of file mastercore_tx.cpp.

References mastercore::DEx_acceptCreate(), and DEX_ERROR_ACCEPT.

+ Here is the call graph for this function:

int CMPTransaction::logicMath_ChangeIssuer ( void  )

Definition at line 676 of file mastercore_tx.cpp.

References mastercore::_my_sps, chainActive, CMPSPInfo::getSP(), CMPSPInfo::hasSP(), CMPSPInfo::Entry::issuer, mastercore::isTransactionTypeAllowed(), PKT_ERROR_TOKENS, CMPSPInfo::Entry::update_block, and CMPSPInfo::updateSP().

+ Here is the call graph for this function:

int CMPTransaction::logicMath_GrantTokens ( void  )
int CMPTransaction::logicMath_MetaDEx ( CMPMetaDEx mdex_o)
int CMPTransaction::logicMath_RevokeTokens ( void  )

Definition at line 629 of file mastercore_tx.cpp.

References mastercore::_my_sps, BALANCE, chainActive, CMPSPInfo::getSP(), CMPSPInfo::hasSP(), CMPSPInfo::Entry::historicalData, mastercore::isTransactionTypeAllowed(), CMPSPInfo::Entry::manual, PKT_ERROR_TOKENS, CMPSPInfo::Entry::update_block, mastercore::update_tally_map(), and CMPSPInfo::updateSP().

+ Here is the call graph for this function:

int CMPTransaction::logicMath_SavingsCompromised ( void  )

Definition at line 725 of file mastercore_tx.cpp.

int CMPTransaction::logicMath_SavingsMark ( void  )

Definition at line 718 of file mastercore_tx.cpp.

int CMPTransaction::logicMath_SendToOwners ( FILE *  fp = NULL)
int CMPTransaction::logicMath_SimpleSend ( void  )
int CMPTransaction::logicMath_TradeOffer ( CMPOffer obj_o)
bool CMPTransaction::operator< ( const CMPTransaction other) const
inline

Definition at line 172 of file mastercore_tx.h.

References block, and tx_idx.

void CMPTransaction::print ( )
inline

Definition at line 179 of file mastercore_tx.h.

References COIN, base_uint< BITS >::GetHex(), and HexStr().

Referenced by mastercore_handler_tx().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CMPTransaction::printInfo ( FILE *  fp)

Definition at line 359 of file mastercore_tx.cpp.

References DateTimeStrFormat().

+ Here is the call graph for this function:

void CMPTransaction::Set ( const uint256 t,
int  b,
unsigned int  idx,
int64_t  bt 
)
inline

Definition at line 148 of file mastercore_tx.h.

Referenced by parseTransaction().

+ Here is the caller graph for this function:

void CMPTransaction::Set ( string  s,
string  r,
uint64_t  n,
const uint256 t,
int  b,
unsigned int  idx,
unsigned char *  p,
unsigned int  size,
int  fMultisig,
uint64_t  txf 
)
inline

Definition at line 156 of file mastercore_tx.h.

References memcpy(), and pkt.

+ Here is the call graph for this function:

void CMPTransaction::SetNull ( )
inline

Definition at line 94 of file mastercore_tx.h.

Referenced by CMPTransaction(), and populateRPCTransactionObject().

+ Here is the caller graph for this function:

int CMPTransaction::step1 ( void  )

Definition at line 56 of file mastercore_tx.cpp.

References mastercore::c_strMasterProtocolTXType(), memcpy(), PACKET_SIZE_CLASS_A, PKT_ERROR, mastercore::swapByteOrder16(), and mastercore::swapByteOrder32().

Referenced by getsto_MP(), gettrade_MP(), populateRPCTransactionObject(), and CMPTxList::setLastAlert().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int CMPTransaction::step2_Alert ( std::string *  new_global_alert_message)

Definition at line 82 of file mastercore_tx.cpp.

References memcpy(), PKT_ERROR, and SP_STRING_FIELD_LEN.

Referenced by CMPTxList::setLastAlert().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char * CMPTransaction::step2_SmartProperty ( int error_code)

Definition at line 189 of file mastercore_tx.cpp.

References mastercore::_my_sps, mastercore::c_strPropertyType(), Checkpoints::data, mastercore::isTransactionTypeAllowed(), memcpy(), MSC_PROPERTY_TYPE_DIVISIBLE, MSC_PROPERTY_TYPE_INDIVISIBLE, OMNI_PROPERTY_MSC, OMNI_PROPERTY_TMSC, CMPSPInfo::peekNextSPID(), PKT_ERROR_SP, mastercore::strMPProperty(), mastercore::swapByteOrder16(), mastercore::swapByteOrder32(), and url.

Referenced by populateRPCTransactionObject().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int CMPTransaction::step2_Value ( void  )

Definition at line 153 of file mastercore_tx.cpp.

References FormatMP(), MAX_INT_8_BYTES, memcpy(), PKT_ERROR, mastercore::strMPProperty(), mastercore::swapByteOrder32(), and mastercore::swapByteOrder64().

Referenced by getsto_MP(), gettrade_MP(), and populateRPCTransactionObject().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int CMPTransaction::step3_sp_fixed ( const char *  p)

Definition at line 271 of file mastercore_tx.cpp.

References COIN, MAX_INT_8_BYTES, memcpy(), MSC_PROPERTY_TYPE_DIVISIBLE, MSC_PROPERTY_TYPE_INDIVISIBLE, PKT_ERROR, PKT_ERROR_SP, and mastercore::swapByteOrder64().

+ Here is the call graph for this function:

int CMPTransaction::step3_sp_variable ( const char *  p)

Definition at line 304 of file mastercore_tx.cpp.

References COIN, DateTimeStrFormat(), MAX_INT_8_BYTES, memcpy(), MSC_PROPERTY_TYPE_DIVISIBLE, MSC_PROPERTY_TYPE_INDIVISIBLE, PKT_ERROR, PKT_ERROR_SP, mastercore::strMPProperty(), mastercore::swapByteOrder32(), and mastercore::swapByteOrder64().

+ Here is the call graph for this function:

Member Data Documentation

int CMPTransaction::block
private

Definition at line 15 of file mastercore_tx.h.

Referenced by operator<().

int64_t CMPTransaction::blockTime
private

Definition at line 26 of file mastercore_tx.h.

char CMPTransaction::category[SP_STRING_FIELD_LEN]
private

Definition at line 33 of file mastercore_tx.h.

char CMPTransaction::data[SP_STRING_FIELD_LEN]
private

Definition at line 37 of file mastercore_tx.h.

uint64_t CMPTransaction::deadline
private

Definition at line 39 of file mastercore_tx.h.

unsigned int CMPTransaction::desired_property
private

Definition at line 44 of file mastercore_tx.h.

uint64_t CMPTransaction::desired_value
private

Definition at line 45 of file mastercore_tx.h.

unsigned char CMPTransaction::early_bird
private

Definition at line 40 of file mastercore_tx.h.

unsigned char CMPTransaction::ecosystem
private

Definition at line 29 of file mastercore_tx.h.

int CMPTransaction::multi
private

Definition at line 20 of file mastercore_tx.h.

char CMPTransaction::name[SP_STRING_FIELD_LEN]
private

Definition at line 35 of file mastercore_tx.h.

uint64_t CMPTransaction::nNewValue
private

Definition at line 25 of file mastercore_tx.h.

Referenced by getNewAmount().

uint64_t CMPTransaction::nValue
private

Definition at line 19 of file mastercore_tx.h.

Referenced by getAmount().

unsigned char CMPTransaction::percentage
private

Definition at line 41 of file mastercore_tx.h.

unsigned char CMPTransaction::pkt[1+MAX_PACKETS *PACKET_SIZE]
private

Definition at line 18 of file mastercore_tx.h.

Referenced by Set().

int CMPTransaction::pkt_size
private

Definition at line 17 of file mastercore_tx.h.

unsigned int CMPTransaction::prev_prop_id
private

Definition at line 31 of file mastercore_tx.h.

unsigned short CMPTransaction::prop_type
private

Definition at line 30 of file mastercore_tx.h.

Referenced by getPropertyType().

unsigned int CMPTransaction::property
private

Definition at line 23 of file mastercore_tx.h.

Referenced by getProperty().

string CMPTransaction::receiver
private

Definition at line 13 of file mastercore_tx.h.

Referenced by getReceiver().

string CMPTransaction::sender
private

Definition at line 12 of file mastercore_tx.h.

Referenced by getSender().

char CMPTransaction::subcategory[SP_STRING_FIELD_LEN]
private

Definition at line 34 of file mastercore_tx.h.

uint64_t CMPTransaction::tx_fee_paid
private

Definition at line 21 of file mastercore_tx.h.

Referenced by getFeePaid().

unsigned int CMPTransaction::tx_idx
private

Definition at line 16 of file mastercore_tx.h.

Referenced by operator<().

uint256 CMPTransaction::txid
private

Definition at line 14 of file mastercore_tx.h.

unsigned int CMPTransaction::type
private

Definition at line 22 of file mastercore_tx.h.

Referenced by getType().

char CMPTransaction::url[SP_STRING_FIELD_LEN]
private

Definition at line 36 of file mastercore_tx.h.

unsigned short CMPTransaction::version
private

Definition at line 24 of file mastercore_tx.h.

Referenced by getVersion().


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