![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
Go to the source code of this file.
Classes | |
class | CMPTally |
struct | CMPTally::BalanceRecord |
class | CMPSTOList |
class | CMPTradeList |
class | CMPTxList |
class | CMPPending |
Namespaces | |
mastercore | |
Typedefs | |
typedef std::map< uint256, CMPPending > | mastercore::PendingMap |
Functions | |
int | mp_LogPrintStr (const std::string &str) |
std::string | FormatDivisibleMP (int64_t n, bool fSign=false) |
std::string | FormatMP (unsigned int, int64_t n, bool fSign=false) |
uint256 | send_MP (const string &FromAddress, const string &ToAddress, const string &RedeemAddress, unsigned int PropertyID, uint64_t Amount) |
int64_t | feeCheck (const string &address) |
const std::string | ExodusAddress () |
int | mastercore_init (void) |
int64_t | getMPbalance (const string &Address, unsigned int property, TallyType ttype) |
int64_t | getUserAvailableMPbalance (const string &Address, unsigned int property) |
bool | IsMyAddress (const std::string &address) |
string | getLabel (const string &address) |
int | mastercore_handler_disc_begin (int nBlockNow, CBlockIndex const *pBlockIndex) |
int | mastercore_handler_disc_end (int nBlockNow, CBlockIndex const *pBlockIndex) |
int | mastercore_handler_block_begin (int nBlockNow, CBlockIndex const *pBlockIndex) |
int | mastercore_handler_block_end (int nBlockNow, CBlockIndex const *pBlockIndex, unsigned int) |
int | mastercore_handler_tx (const CTransaction &tx, int nBlock, unsigned int idx, CBlockIndex const *pBlockIndex) |
int | mastercore_save_state (CBlockIndex const *pBlockIndex) |
string | mastercore::strMPProperty (unsigned int i) |
int | mastercore::GetHeight (void) |
uint32_t | mastercore::GetLatestBlockTime (void) |
bool | mastercore::isPropertyDivisible (unsigned int propertyId) |
string | mastercore::getPropertyName (unsigned int propertyId) |
bool | mastercore::isCrowdsaleActive (unsigned int propertyId) |
bool | mastercore::isCrowdsalePurchase (uint256 txid, string address, int64_t *propertyId=NULL, int64_t *userTokens=NULL, int64_t *issuerTokens=NULL) |
bool | mastercore::isMPinBlockRange (int starting_block, int ending_block, bool bDeleteFound) |
std::string | mastercore::FormatIndivisibleMP (int64_t n) |
int | mastercore::ClassB_send (const string &senderAddress, const string &receiverAddress, const string &redemptionAddress, const vector< unsigned char > &data, uint256 &txid, int64_t additional=0) |
uint256 | mastercore::send_INTERNAL_1packet (const string &FromAddress, const string &ToAddress, const string &RedeemAddress, unsigned int PropertyID, uint64_t Amount, unsigned int PropertyID_2, uint64_t Amount_2, unsigned int TransactionType, int64_t additional, int *error_code=NULL) |
bool | mastercore::isTestEcosystemProperty (unsigned int property) |
bool | mastercore::isMainEcosystemProperty (unsigned int property) |
CMPTally * | mastercore::getTally (const string &address) |
bool | mastercore::isMetaDExOfferActive (const uint256 txid, unsigned int propertyId) |
int64_t | mastercore::getTotalTokens (unsigned int propertyId, int64_t *n_owners_total=NULL) |
bool | mastercore::checkExpiredAlerts (unsigned int curBlock, uint64_t curTime) |
int | mastercore::set_wallet_totals () |
char * | mastercore::c_strMasterProtocolTXType (int i) |
bool | mastercore::isTransactionTypeAllowed (int txBlock, unsigned int txProperty, unsigned int txType, unsigned short version, bool bAllowNullProperty=false) |
bool | mastercore::getValidMPTX (const uint256 &txid, int *block=NULL, unsigned int *type=NULL, uint64_t *nAmended=NULL) |
bool | mastercore::update_tally_map (string who, unsigned int which_currency, int64_t amount, TallyType ttype) |
std::string | mastercore::getMasterCoreAlertString () |
Variables | |
int const | MAX_STATE_HISTORY = 50 |
CCriticalSection | cs_tally |
const int | msc_debug_dex |
uint64_t | global_MSC_total |
uint64_t | global_MSC_RESERVED_total |
uint64_t | global_balance_money_maineco [100000] |
uint64_t | global_balance_reserved_maineco [100000] |
uint64_t | global_balance_money_testeco [100000] |
uint64_t | global_balance_reserved_testeco [100000] |
std::map< string, CMPTally > | mastercore::mp_tally_map |
CMPTxList * | mastercore::p_txlistdb |
CMPTradeList * | mastercore::t_tradelistdb |
CMPSTOList * | mastercore::s_stolistdb |
#define DEV_MSC_BLOCK_290629 (1743358325718) |
Definition at line 29 of file mastercore.h.
#define DEX_ERROR_ACCEPT (-20000) |
Definition at line 117 of file mastercore.h.
Referenced by mastercore::DEx_acceptCreate(), mastercore::DEx_acceptDestroy(), and CMPTransaction::logicMath_AcceptOffer_BTC().
#define DEX_ERROR_PAYMENT (-30000) |
Definition at line 118 of file mastercore.h.
Referenced by mastercore::DEx_payment().
#define DEX_ERROR_SELLOFFER (-10000) |
Definition at line 116 of file mastercore.h.
Referenced by mastercore::DEx_offerCreate(), mastercore::DEx_offerDestroy(), and mastercore::DEx_offerUpdate().
#define DISABLE_METADEX |
Definition at line 14 of file mastercore.h.
#define FORMAT_BOOST_SPKEY "sp-%d" |
Definition at line 38 of file mastercore.h.
Referenced by CMPSPInfo::getSP(), CMPSPInfo::hasSP(), CMPSPInfo::putSP(), and CMPSPInfo::updateSP().
#define FORMAT_BOOST_TXINDEXKEY "index-tx-%s" |
Definition at line 37 of file mastercore.h.
Referenced by CMPSPInfo::findSPByTX(), CMPSPInfo::popBlock(), and CMPSPInfo::putSP().
#define INFO_FILENAME "mastercore_crowdsales.log" |
Definition at line 17 of file mastercore.h.
Referenced by mastercore::dumpCrowdsaleInfo().
#define LOG_FILENAME "mastercore.log" |
Definition at line 16 of file mastercore.h.
Referenced by mp_DebugPrintInit(), mp_LogPrintStr(), and shrinkDebugFile().
#define MAX_BTC_OUTPUTS 16 |
Definition at line 45 of file mastercore.h.
Referenced by parseTransaction().
#define MAX_INT_8_BYTES (9223372036854775807UL) |
Definition at line 26 of file mastercore.h.
Referenced by calculateFundraiser(), isMultiplicationOK(), isRangeOK(), CMPTransaction::logicMath_GrantTokens(), CMPTransaction::step2_Value(), CMPTransaction::step3_sp_fixed(), and CMPTransaction::step3_sp_variable().
#define MAX_PACKETS 64 |
Definition at line 51 of file mastercore.h.
Referenced by parseTransaction().
#define MAX_SHA256_OBFUSCATION_TIMES 255 |
Definition at line 47 of file mastercore.h.
Referenced by mastercore::ClassB_send(), parseTransaction(), and prepareObfuscatedHashes().
#define METADEX_ERROR (-81000) |
Definition at line 126 of file mastercore.h.
Referenced by input_mp_offers_string(), mastercore::MetaDEx_ADD(), mastercore::MetaDEx_CANCEL_ALL_FOR_PAIR(), mastercore::MetaDEx_CANCEL_AT_PRICE(), and mastercore::MetaDEx_CANCEL_EVERYTHING().
#define MP_MAKE_ERROR_AND_LOG_FUNC | ( | n | ) |
Definition at line 138 of file mastercore.h.
#define MP_TX_PKT_V0 0 |
Definition at line 41 of file mastercore.h.
Referenced by CMPTransaction::logicMath_TradeOffer().
#define MP_TX_PKT_V1 1 |
Definition at line 42 of file mastercore.h.
Referenced by CMPTransaction::logicMath_TradeOffer().
#define MSC_PROPERTY_TYPE_DIVISIBLE 2 |
Definition at line 79 of file mastercore.h.
Referenced by mastercore::c_strPropertyType(), mastercore::calculateFractional(), CMPSPInfo::CMPSPInfo(), CMPSPInfo::Entry::isDivisible(), CMPTransaction::step2_SmartProperty(), CMPTransaction::step3_sp_fixed(), and CMPTransaction::step3_sp_variable().
#define MSC_PROPERTY_TYPE_DIVISIBLE_APPENDING 130 |
Definition at line 83 of file mastercore.h.
Referenced by CMPSPInfo::Entry::isDivisible().
#define MSC_PROPERTY_TYPE_DIVISIBLE_REPLACING 66 |
Definition at line 81 of file mastercore.h.
Referenced by CMPSPInfo::Entry::isDivisible().
#define MSC_PROPERTY_TYPE_INDIVISIBLE 1 |
Definition at line 78 of file mastercore.h.
Referenced by mastercore::c_strPropertyType(), CMPTransaction::step2_SmartProperty(), CMPTransaction::step3_sp_fixed(), and CMPTransaction::step3_sp_variable().
#define MSC_PROPERTY_TYPE_INDIVISIBLE_APPENDING 129 |
Definition at line 82 of file mastercore.h.
#define MSC_PROPERTY_TYPE_INDIVISIBLE_REPLACING 65 |
Definition at line 80 of file mastercore.h.
#define OMNI_PROPERTY_BTC 0 |
Definition at line 129 of file mastercore.h.
Referenced by input_mp_offers_string(), mastercore::isMainEcosystemProperty(), mastercore::isTransactionTypeAllowed(), CMPOffer::saveOffer(), and mastercore::strMPProperty().
#define OMNI_PROPERTY_MSC 1 |
Definition at line 130 of file mastercore.h.
Referenced by calculate_and_update_devmsc(), mastercore::checkExpiredAlerts(), mastercore::DEx_payment(), CMPSPInfo::getSP(), CMPSPInfo::hasSP(), input_msc_balances_string(), CMPTransaction::logicMath_SendToOwners(), CMPTransaction::logicMath_TradeOffer(), mastercore_handler_block_end(), mastercore_init(), mastercore::MetaDEx_ADD(), CMPSPInfo::peekNextSPID(), CMPSPInfo::printAll(), CMPSPInfo::putSP(), CMPTransaction::step2_SmartProperty(), mastercore::strMPProperty(), TXExodusFundraiser(), CMPSPInfo::updateSP(), and write_globals_state().
#define OMNI_PROPERTY_TMSC 2 |
Definition at line 131 of file mastercore.h.
Referenced by mastercore::DEx_payment(), CMPSPInfo::getSP(), CMPSPInfo::hasSP(), mastercore::isTestEcosystemProperty(), CMPTransaction::logicMath_SendToOwners(), CMPTransaction::logicMath_TradeOffer(), mastercore::MetaDEx_ADD(), CMPSPInfo::peekNextSPID(), CMPSPInfo::printAll(), CMPSPInfo::putSP(), CMPTransaction::step2_SmartProperty(), mastercore::strMPProperty(), TXExodusFundraiser(), CMPSPInfo::updateSP(), and write_globals_state().
#define OWNERS_FILENAME "mastercore_owners.log" |
Definition at line 18 of file mastercore.h.
Referenced by CMPTransaction::interpretPacket().
#define PACKET_SIZE 31 |
Definition at line 50 of file mastercore.h.
Referenced by mastercore::ClassB_send(), and parseTransaction().
#define PACKET_SIZE_CLASS_A 19 |
Definition at line 49 of file mastercore.h.
Referenced by parseTransaction(), and CMPTransaction::step1().
#define PKT_ERROR ( -9000) |
Definition at line 115 of file mastercore.h.
Referenced by CMPTransaction::interpretPacket(), CMPTransaction::logicMath_SimpleSend(), CMPTransaction::logicMath_TradeOffer(), CMPTransaction::step1(), CMPTransaction::step2_Alert(), CMPTransaction::step2_Value(), CMPTransaction::step3_sp_fixed(), and CMPTransaction::step3_sp_variable().
#define PKT_ERROR_METADEX (-80000) |
Definition at line 125 of file mastercore.h.
Referenced by CMPTransaction::logicMath_MetaDEx().
#define PKT_ERROR_SEND (-60000) |
Definition at line 123 of file mastercore.h.
Referenced by CMPTransaction::logicMath_SimpleSend().
#define PKT_ERROR_SP (-40000) |
Definition at line 120 of file mastercore.h.
Referenced by CMPTransaction::interpretPacket(), CMPTransaction::step2_SmartProperty(), CMPTransaction::step3_sp_fixed(), and CMPTransaction::step3_sp_variable().
#define PKT_ERROR_STO (-50000) |
Definition at line 122 of file mastercore.h.
Referenced by CMPTransaction::logicMath_SendToOwners().
#define PKT_ERROR_TOKENS (-82000) |
Definition at line 127 of file mastercore.h.
Referenced by CMPTransaction::logicMath_ChangeIssuer(), CMPTransaction::logicMath_GrantTokens(), and CMPTransaction::logicMath_RevokeTokens().
#define PKT_ERROR_TRADEOFFER (-70000) |
Definition at line 124 of file mastercore.h.
Referenced by CMPTransaction::logicMath_TradeOffer().
#define PKT_RETURNED_OBJECT (1000) |
Definition at line 113 of file mastercore.h.
Referenced by CMPTransaction::logicMath_MetaDEx(), and CMPTransaction::logicMath_TradeOffer().
#define SP_STRING_FIELD_LEN 256 |
Definition at line 31 of file mastercore.h.
Referenced by CMPTransaction::step2_Alert().
#define TEST_ECO_PROPERTY_1 (0x80000003UL) |
Definition at line 22 of file mastercore.h.
Referenced by mastercore::isCrowdsalePurchase(), mastercore::isTestEcosystemProperty(), listproperties_MP(), and mastercore::set_wallet_totals().
#define TRANSFER_FEE_PER_OWNER (1) |
Definition at line 34 of file mastercore.h.
Referenced by CMPTransaction::logicMath_SendToOwners().
Definition at line 86 of file mastercore.h.
enum FILETYPES |
Enumerator | |
---|---|
FILETYPE_BALANCES | |
FILETYPE_OFFERS | |
FILETYPE_ACCEPTS | |
FILETYPE_GLOBALS | |
FILETYPE_CROWDSALES | |
NUM_FILETYPES |
Definition at line 104 of file mastercore.h.
enum TallyType |
Enumerator | |
---|---|
BALANCE | |
SELLOFFER_RESERVE | |
ACCEPT_RESERVE | |
PENDING | |
METADEX_RESERVE | |
TALLY_TYPE_COUNT |
Definition at line 189 of file mastercore.h.
enum TransactionType |
Definition at line 54 of file mastercore.h.
const std::string ExodusAddress | ( | ) |
Definition at line 4085 of file mastercore.cpp.
References exodus_address.
Referenced by CMPSPInfo::CMPSPInfo().
int64_t feeCheck | ( | const string & | address | ) |
Definition at line 2733 of file mastercore.cpp.
References selectCoins().
Referenced by SendMPDialog::updateFrom().
std::string FormatDivisibleMP | ( | int64_t | n, |
bool | fSign = false |
||
) |
Definition at line 325 of file mastercore.cpp.
References COIN, and strprintf.
Referenced by MatrixModel::fillin(), FormatMP(), getactivedexsells_MP(), CMPTradeList::getMatchingTrades(), CMPSTOList::getRecipients(), getsto_MP(), listtransactions_MP(), mastercore_init(), mscrpc(), populateRPCTransactionObject(), CMPTally::print(), SendMPDialog::sendMPTransaction(), SendMPDialog::updateBalances(), and SendMPDialog::updateFrom().
std::string FormatMP | ( | unsigned | int, |
int64_t | n, | ||
bool | fSign = false |
||
) |
Definition at line 349 of file mastercore.cpp.
References FormatDivisibleMP(), mastercore::FormatIndivisibleMP(), and mastercore::isPropertyDivisible().
Referenced by BalanceToJSON(), getactivecrowdsales_MP(), getcrowdsale_MP(), getgrants_MP(), getproperty_MP(), gettrade_MP(), CMPTransaction::logicMath_MetaDEx(), CMPTransaction::logicMath_SendToOwners(), MetaDexObjectToJSON(), populateRPCTransactionObject(), CMPTransaction::step2_Value(), and CMPMetaDEx::ToString().
string getLabel | ( | const string & | address | ) |
Definition at line 2620 of file mastercore.cpp.
References CWallet::cs_wallet, CBitcoinAddress::Get(), LOCK, CWallet::mapAddressBook, and pwalletMain.
Referenced by MatrixModel::fillin().
Definition at line 437 of file mastercore.cpp.
References LOCK, mastercore::mp_tally_map, and TALLY_TYPE_COUNT.
Referenced by BalanceToJSON(), mastercore::DEx_acceptCreate(), mastercore::DEx_offerCreate(), mastercore::DEx_offerDestroy(), mastercore::DEx_payment(), MatrixModel::fillin(), getactivedexsells_MP(), mastercore::getTotalTokens(), getUserAvailableMPbalance(), CMPTransaction::logicMath_MetaDEx(), CMPTransaction::logicMath_SendToOwners(), mastercore_handler_block_end(), mastercore_init(), pendingDelete(), mastercore::send_INTERNAL_1packet(), mastercore::set_wallet_totals(), and mastercore::update_tally_map().
int64_t getUserAvailableMPbalance | ( | const string & | Address, |
unsigned int | property | ||
) |
Definition at line 455 of file mastercore.cpp.
References BALANCE, getMPbalance(), and PENDING.
Referenced by BalanceToJSON(), MatrixModel::fillin(), mastercore::send_INTERNAL_1packet(), SendMPDialog::sendMPTransaction(), mastercore::set_wallet_totals(), and SendMPDialog::updateBalances().
bool IsMyAddress | ( | const std::string & | address | ) |
Definition at line 2608 of file mastercore.cpp.
References CBitcoinAddress::Get(), IsMine(), and pwalletMain.
Referenced by MatrixModel::fillin(), CMPSTOList::getMySTOReceipts(), CMPSTOList::getRecipients(), populateRPCTransactionObject(), mastercore::set_wallet_totals(), and SendMPDialog::updateProperty().
int mastercore_handler_block_begin | ( | int | nBlockNow, |
CBlockIndex const * | pBlockIndex | ||
) |
Definition at line 3989 of file mastercore.cpp.
References clear_all_state(), CMPSTOList::deleteAboveBlock(), CMPTradeList::deleteAboveBlock(), mastercore::eraseExpiredCrowdsale(), GENESIS_BLOCK, CMPTxList::isMPinBlockRange(), isNonMainNet(), load_most_relevant_state(), msc_initial_scan(), CBlockIndex::nHeight, mastercore::p_txlistdb, readPersistence(), RegTest(), mastercore::s_stolistdb, START_REGTEST_BLOCK, START_TESTNET_BLOCK, and mastercore::t_tradelistdb.
Referenced by msc_initial_scan().
int mastercore_handler_block_end | ( | int | nBlockNow, |
CBlockIndex const * | pBlockIndex, | ||
unsigned | int | ||
) |
Definition at line 4034 of file mastercore.cpp.
References BALANCE, calculate_and_update_devmsc(), mastercore::checkExpiredAlerts(), eraseExpiredAccepts(), exodus_address, CBlockIndex::GetBlockTime(), getMPbalance(), mastercore_init(), mastercore_save_state(), OMNI_PROPERTY_MSC, mastercore::set_wallet_totals(), and writePersistence().
Referenced by msc_initial_scan().
int mastercore_handler_disc_begin | ( | int | nBlockNow, |
CBlockIndex const * | pBlockIndex | ||
) |
Definition at line 4074 of file mastercore.cpp.
References CBlockIndex::nHeight, and reorgRecoveryMaxHeight.
int mastercore_handler_disc_end | ( | int | nBlockNow, |
CBlockIndex const * | pBlockIndex | ||
) |
Definition at line 4081 of file mastercore.cpp.
int mastercore_handler_tx | ( | const CTransaction & | tx, |
int | nBlock, | ||
unsigned int | idx, | ||
CBlockIndex const * | pBlockIndex | ||
) |
Definition at line 2567 of file mastercore.cpp.
References CBlockIndex::GetBlockTime(), CTransaction::GetHash(), CMPTransaction::getNewAmount(), CMPTransaction::getType(), CMPTransaction::interpretPacket(), mastercore_init(), mastercore::p_txlistdb, parseTransaction(), pendingDelete(), CMPTransaction::print(), and CMPTxList::recordTX().
Referenced by msc_initial_scan().
int mastercore_init | ( | void | ) |
Definition at line 2405 of file mastercore.cpp.
References mastercore::_my_sps, BALANCE, clear_all_state(), DateTimeStrFormat(), exodus_address, exodus_balance, exodus_prev, exodus_testnet, FormatDivisibleMP(), fReindex, GENESIS_BLOCK, GetBoolArg(), GetDataDir(), getMPbalance(), GetTime(), isNonMainNet(), load_most_relevant_state(), mastercoreInitialized, MPPersistencePath, msc_initial_scan(), OMNI_PROPERTY_MSC, mastercore::p_txlistdb, readPersistence(), RegTest(), mastercore::s_stolistdb, CMPTxList::setLastAlert(), shrinkDebugFile(), START_REGTEST_BLOCK, START_TESTNET_BLOCK, mastercore::t_tradelistdb, TestNet(), and mastercore::update_tally_map().
Referenced by mastercore_handler_block_end(), and mastercore_handler_tx().
int mastercore_save_state | ( | CBlockIndex const * | pBlockIndex | ) |
Definition at line 2378 of file mastercore.cpp.
References mastercore::_my_sps, FILETYPE_ACCEPTS, FILETYPE_BALANCES, FILETYPE_CROWDSALES, FILETYPE_GLOBALS, FILETYPE_OFFERS, CBlockIndex::phashBlock, prune_state_files(), CMPSPInfo::setWatermark(), and write_state_file().
Referenced by mastercore_handler_block_end().
int mp_LogPrintStr | ( | const std::string & | str | ) |
Definition at line 204 of file mastercore.cpp.
References DateTimeStrFormat(), fileout, fLogTimestamps, fPrintToConsole, fPrintToDebugLog, fReopenDebugLog, GetDataDir(), GetTime(), LOG_FILENAME, mp_DebugPrintInit(), mp_debugPrintInitFlag, and mutexDebugLog.
uint256 send_MP | ( | const string & | FromAddress, |
const string & | ToAddress, | ||
const string & | RedeemAddress, | ||
unsigned int | PropertyID, | ||
uint64_t | Amount | ||
) |
CCriticalSection cs_tally |
Definition at line 357 of file mastercore.cpp.
Referenced by MatrixModel::fillin(), CMPTally::getMoney(), CMPTally::updateMoney(), and SendMPDialog::updateProperty().
uint64_t global_balance_money_maineco[100000] |
Definition at line 90 of file mastercore.cpp.
uint64_t global_balance_money_testeco[100000] |
Definition at line 92 of file mastercore.cpp.
uint64_t global_balance_reserved_maineco[100000] |
Definition at line 91 of file mastercore.cpp.
uint64_t global_balance_reserved_testeco[100000] |
Definition at line 93 of file mastercore.cpp.
uint64_t global_MSC_RESERVED_total |
Definition at line 89 of file mastercore.cpp.
uint64_t global_MSC_total |
Definition at line 88 of file mastercore.cpp.
int const MAX_STATE_HISTORY = 50 |
Definition at line 20 of file mastercore.h.
Referenced by prune_state_files(), and writePersistence().
const int msc_debug_dex |
Definition at line 109 of file mastercore.cpp.
Referenced by CMPOffer::CMPOffer(), mastercore::DEx_acceptCreate(), mastercore::DEx_getAccept(), mastercore::DEx_getOffer(), mastercore::DEx_offerCreate(), mastercore::DEx_offerDestroy(), and mastercore::DEx_payment().