Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
#include <mastercore_tx.h>
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 |
Definition at line 9 of file mastercore_tx.h.
Enumerator | |
---|---|
INVALID | |
NEW | |
UPDATE | |
CANCEL | |
ADD | |
CANCEL_AT_PRICE | |
CANCEL_ALL_FOR_PAIR | |
CANCEL_EVERYTHING |
Definition at line 59 of file mastercore_tx.h.
|
inline |
Definition at line 123 of file mastercore_tx.h.
References SetNull().
|
inline |
Definition at line 87 of file mastercore_tx.h.
References nValue.
Referenced by gettrade_MP(), and populateRPCTransactionObject().
|
inline |
Definition at line 82 of file mastercore_tx.h.
References tx_fee_paid.
Referenced by populateRPCTransactionObject().
|
inline |
Definition at line 88 of file mastercore_tx.h.
References nNewValue.
Referenced by mastercore_handler_tx().
|
inline |
Definition at line 79 of file mastercore_tx.h.
References property.
Referenced by getsto_MP(), gettrade_MP(), and populateRPCTransactionObject().
|
inline |
Definition at line 81 of file mastercore_tx.h.
References prop_type.
|
inline |
Definition at line 85 of file mastercore_tx.h.
References receiver.
Referenced by populateRPCTransactionObject().
|
inline |
Definition at line 84 of file mastercore_tx.h.
References sender.
Referenced by gettrade_MP(), and populateRPCTransactionObject().
|
inline |
Definition at line 90 of file mastercore_tx.h.
Referenced by populateRPCTransactionObject().
|
inline |
Definition at line 77 of file mastercore_tx.h.
References type.
Referenced by getTypeString(), mastercore_handler_tx(), populateRPCTransactionObject(), and CMPTxList::setLastAlert().
|
inline |
Definition at line 78 of file mastercore_tx.h.
References mastercore::c_strMasterProtocolTXType(), and getType().
Referenced by populateRPCTransactionObject().
|
inline |
Definition at line 80 of file mastercore_tx.h.
References version.
Referenced by populateRPCTransactionObject().
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().
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.
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().
int CMPTransaction::logicMath_GrantTokens | ( | void | ) |
Definition at line 564 of file mastercore_tx.cpp.
References mastercore::_my_sps, BALANCE, chainActive, COIN, CMPSPInfo::getSP(), CMPSPInfo::hasSP(), CMPSPInfo::Entry::historicalData, CMPSPInfo::Entry::isDivisible(), CMPSPInfo::Entry::issuer, mastercore::isTransactionTypeAllowed(), CMPSPInfo::Entry::manual, MAX_INT_8_BYTES, CMPSPInfo::Entry::num_tokens, PKT_ERROR_TOKENS, CMPSPInfo::Entry::update_block, mastercore::update_tally_map(), and CMPSPInfo::updateSP().
int CMPTransaction::logicMath_MetaDEx | ( | CMPMetaDEx * | mdex_o | ) |
Definition at line 487 of file mastercore_tx.cpp.
References mastercore::_my_sps, BALANCE, FormatMP(), getMPbalance(), CMPSPInfo::hasSP(), mastercore::isTestEcosystemProperty(), mastercore::isTransactionTypeAllowed(), memcpy(), mastercore::MetaDEx_ADD(), mastercore::MetaDEx_CANCEL_ALL_FOR_PAIR(), mastercore::MetaDEx_CANCEL_AT_PRICE(), mastercore::MetaDEx_CANCEL_EVERYTHING(), PKT_ERROR_METADEX, PKT_RETURNED_OBJECT, CMPMetaDEx::Set(), mastercore::strMPProperty(), mastercore::swapByteOrder32(), and mastercore::swapByteOrder64().
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().
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 | ) |
Definition at line 4510 of file mastercore.cpp.
References ACCEPT_RESERVE, BALANCE, COIN, FormatMP(), getMPbalance(), mastercore::getTotalTokens(), mastercore::isTestEcosystemProperty(), mastercore::isTransactionTypeAllowed(), METADEX_RESERVE, mastercore::mp_tally_map, OMNI_PROPERTY_MSC, OMNI_PROPERTY_TMSC, PKT_ERROR_STO, CMPSTOList::recordSTOReceive(), mastercore::s_stolistdb, SELLOFFER_RESERVE, mastercore::strMPProperty(), TRANSFER_FEE_PER_OWNER, and mastercore::update_tally_map().
int CMPTransaction::logicMath_SimpleSend | ( | void | ) |
Definition at line 4401 of file mastercore.cpp.
References mastercore::_my_sps, BALANCE, calculateFundraiser(), CMPSPInfo::Entry::deadline, CMPSPInfo::Entry::early_bird, mastercore::eraseMaxedCrowdsale(), mastercore::getCrowd(), CMPCrowd::getCurrDes(), base_uint< BITS >::GetHex(), CMPCrowd::getPropertyId(), CMPSPInfo::getSP(), mastercore::getTotalTokens(), CMPCrowd::incTokensIssuerCreated(), CMPCrowd::incTokensUserCreated(), CMPCrowd::insertDatabase(), mastercore::isPropertyDivisible(), mastercore::isTransactionTypeAllowed(), CMPSPInfo::Entry::num_tokens, CMPSPInfo::Entry::percentage, PKT_ERROR, PKT_ERROR_SEND, CMPSPInfo::Entry::prop_type, CMPSPInfo::Entry::txid, and mastercore::update_tally_map().
Definition at line 365 of file mastercore_tx.cpp.
References COIN, mastercore::DEx_offerCreate(), mastercore::DEx_offerDestroy(), mastercore::DEx_offerExists(), mastercore::DEx_offerUpdate(), mastercore::isTransactionTypeAllowed(), memcpy(), MP_TX_PKT_V0, MP_TX_PKT_V1, OMNI_PROPERTY_MSC, OMNI_PROPERTY_TMSC, PKT_ERROR, PKT_ERROR_TRADEOFFER, PKT_RETURNED_OBJECT, CMPOffer::Set(), and mastercore::swapByteOrder64().
|
inline |
Definition at line 172 of file mastercore_tx.h.
|
inline |
Definition at line 179 of file mastercore_tx.h.
References COIN, base_uint< BITS >::GetHex(), and HexStr().
Referenced by mastercore_handler_tx().
void CMPTransaction::printInfo | ( | FILE * | fp | ) |
Definition at line 359 of file mastercore_tx.cpp.
References DateTimeStrFormat().
Definition at line 148 of file mastercore_tx.h.
Referenced by parseTransaction().
|
inline |
|
inline |
Definition at line 94 of file mastercore_tx.h.
Referenced by CMPTransaction(), and populateRPCTransactionObject().
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().
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().
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().
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().
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().
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().
|
private |
Definition at line 15 of file mastercore_tx.h.
Referenced by operator<().
|
private |
Definition at line 26 of file mastercore_tx.h.
|
private |
Definition at line 33 of file mastercore_tx.h.
|
private |
Definition at line 37 of file mastercore_tx.h.
|
private |
Definition at line 39 of file mastercore_tx.h.
|
private |
Definition at line 44 of file mastercore_tx.h.
|
private |
Definition at line 45 of file mastercore_tx.h.
|
private |
Definition at line 40 of file mastercore_tx.h.
|
private |
Definition at line 29 of file mastercore_tx.h.
|
private |
Definition at line 20 of file mastercore_tx.h.
|
private |
Definition at line 35 of file mastercore_tx.h.
|
private |
Definition at line 25 of file mastercore_tx.h.
Referenced by getNewAmount().
|
private |
Definition at line 19 of file mastercore_tx.h.
Referenced by getAmount().
|
private |
Definition at line 41 of file mastercore_tx.h.
|
private |
Definition at line 18 of file mastercore_tx.h.
Referenced by Set().
|
private |
Definition at line 17 of file mastercore_tx.h.
|
private |
Definition at line 31 of file mastercore_tx.h.
|
private |
Definition at line 30 of file mastercore_tx.h.
Referenced by getPropertyType().
|
private |
Definition at line 23 of file mastercore_tx.h.
Referenced by getProperty().
|
private |
Definition at line 13 of file mastercore_tx.h.
Referenced by getReceiver().
|
private |
Definition at line 12 of file mastercore_tx.h.
Referenced by getSender().
|
private |
Definition at line 34 of file mastercore_tx.h.
|
private |
Definition at line 21 of file mastercore_tx.h.
Referenced by getFeePaid().
|
private |
Definition at line 16 of file mastercore_tx.h.
Referenced by operator<().
|
private |
Definition at line 14 of file mastercore_tx.h.
|
private |
Definition at line 22 of file mastercore_tx.h.
Referenced by getType().
|
private |
Definition at line 36 of file mastercore_tx.h.
|
private |
Definition at line 24 of file mastercore_tx.h.
Referenced by getVersion().