Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
mastercore.cpp File Reference
#include "base58.h"
#include "rpcserver.h"
#include "init.h"
#include "util.h"
#include "wallet.h"
#include "coincontrol.h"
#include <stdint.h>
#include <string.h>
#include <set>
#include <map>
#include <fstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <string>
#include <boost/assign/list_of.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/find.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/format.hpp>
#include <boost/filesystem.hpp>
#include "json/json_spirit_utils.h"
#include "json/json_spirit_value.h"
#include "leveldb/db.h"
#include "leveldb/write_batch.h"
#include <openssl/sha.h>
#include <boost/multiprecision/cpp_int.hpp>
#include "mastercore.h"
#include "mastercore_convert.h"
#include "mastercore_dex.h"
#include "mastercore_tx.h"
#include "mastercore_sp.h"
#include "mastercore_errors.h"
#include "mastercore_version.h"
+ Include dependency graph for mastercore.cpp:

Go to the source code of this file.

Functions

static void mp_DebugPrintInit ()
 
int mp_LogPrintStr (const std::string &str)
 
static bool readPersistence ()
 
static bool writePersistence (int block_now)
 
static void shrinkDebugFile ()
 
bool isNonMainNet ()
 
string FormatDivisibleMP (int64_t n, bool fSign)
 
std::string FormatMP (unsigned int property, int64_t n, bool fSign)
 
static CMPPendingpendingDelete (const uint256 txid, bool bErase=false)
 
static int pendingAdd (const uint256 &txid, const string &FromAddress, unsigned int propId, int64_t Amount)
 
int64_t getMPbalance (const string &Address, unsigned int property, TallyType ttype)
 
int64_t getUserAvailableMPbalance (const string &Address, unsigned int property)
 
static bool isRangeOK (const uint64_t input)
 
bool isMultiplicationOK (const uint64_t a, const uint64_t b)
 
std::string p128 (int128_t quantity)
 
std::string p_arb (cpp_int quantity)
 
void calculateFundraiser (unsigned short int propType, uint64_t amtTransfer, unsigned char bonusPerc, uint64_t fundraiserSecs, uint64_t currentSecs, uint64_t numProps, unsigned char issuerPerc, uint64_t totalTokens, std::pair< uint64_t, uint64_t > &tokens, bool &close_crowdsale)
 
uint64_t calculate_and_update_devmsc (unsigned int nTime)
 
static void prepareObfuscatedHashes (const string &address, string(&ObfsHashes)[1+MAX_SHA256_OBFUSCATION_TIMES])
 
static bool getOutputType (const CScript &scriptPubKey, txnouttype &whichTypeRet)
 
int TXExodusFundraiser (const CTransaction &wtx, const string &sender, int64_t ExodusHighestValue, int nBlock, unsigned int nTime)
 
static bool isAllowedOutputType (int whichType, int nBlock)
 
int parseTransaction (bool bRPConly, const CTransaction &wtx, int nBlock, unsigned int idx, CMPTransaction *mp_tx, unsigned int nTime)
 
int msc_initial_scan (int nHeight)
 
int input_msc_balances_string (const string &s)
 
int input_mp_offers_string (const string &s)
 
int input_mp_accepts_string (const string &s)
 
int input_globals_state_string (const string &s)
 
int input_mp_crowdsale_string (const string &s)
 
static int msc_file_load (const string &filename, int what, bool verifyHash=false)
 
static int load_most_relevant_state ()
 
static int write_msc_balances (ofstream &file, SHA256_CTX *shaCtx)
 
static int write_mp_offers (ofstream &file, SHA256_CTX *shaCtx)
 
static int write_mp_metadex (ofstream &file, SHA256_CTX *shaCtx)
 
static int write_mp_accepts (ofstream &file, SHA256_CTX *shaCtx)
 
static int write_globals_state (ofstream &file, SHA256_CTX *shaCtx)
 
static int write_mp_crowdsales (ofstream &file, SHA256_CTX *shaCtx)
 
static int write_state_file (CBlockIndex const *pBlockIndex, int what)
 
static bool is_state_prefix (std::string const &str)
 
static void prune_state_files (CBlockIndex const *topIndex)
 
int mastercore_save_state (CBlockIndex const *pBlockIndex)
 
static void clear_all_state ()
 
int mastercore_init ()
 
int mastercore_shutdown ()
 
int mastercore_handler_tx (const CTransaction &tx, int nBlock, unsigned int idx, CBlockIndex const *pBlockIndex)
 
bool IsMyAddress (const std::string &address)
 
string getLabel (const string &address)
 
int64_t GetDustLimit (const CScript &scriptPubKey)
 
static int64_t selectCoins (const string &FromAddress, CCoinControl &coinControl, int64_t additional)
 
int64_t feeCheck (const string &address)
 
int mastercore_handler_block_begin (int nBlockPrev, CBlockIndex const *pBlockIndex)
 
int mastercore_handler_block_end (int nBlockNow, CBlockIndex const *pBlockIndex, unsigned int countMP)
 
int mastercore_handler_disc_begin (int nBlockNow, CBlockIndex const *pBlockIndex)
 
int mastercore_handler_disc_end (int nBlockNow, CBlockIndex const *pBlockIndex)
 
const std::string ExodusAddress ()
 
const std::string NotificationAddress ()
 

Variables

static string exodus_address = "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P"
 
static const string exodus_testnet = "mpexoDuSkGGqvqrkrjiFng38QPkJQVFyqv"
 
static const string getmoney_testnet = "moneyqMan7uh8FqdCA2BV5yZ8qVrc9ikLP"
 
static const int nBlockTop = 0
 
static int nWaterlineBlock = 0
 
uint64_t global_MSC_total = 0
 
uint64_t global_MSC_RESERVED_total = 0
 
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]
 
string global_alert_message
 
static uint64_t exodus_prev = 0
 
static uint64_t exodus_balance
 
static boost::filesystem::path MPPersistencePath
 
const int msc_debug_parser_data = 0
 
const int msc_debug_parser = 0
 
const int msc_debug_verbose =0
 
const int msc_debug_verbose2 =0
 
const int msc_debug_verbose3 =0
 
const int msc_debug_vin = 0
 
const int msc_debug_script = 0
 
const int msc_debug_dex = 1
 
const int msc_debug_send = 1
 
const int msc_debug_tokens = 0
 
const int msc_debug_spec = 1
 
const int msc_debug_exo = 0
 
const int msc_debug_tally = 1
 
const int msc_debug_sp = 1
 
const int msc_debug_sto = 1
 
const int msc_debug_txdb = 0
 
const int msc_debug_tradedb = 1
 
const int msc_debug_persistence = 0
 
int msc_debug_metadex1 = 0
 
int msc_debug_metadex2 = 0
 
int msc_debug_metadex3 = 0
 
static const int disable_Divs = 0
 
static const int disableLevelDB = 0
 
static int mastercoreInitialized = 0
 
static int reorgRecoveryMode = 0
 
static int reorgRecoveryMaxHeight = 0
 
static bool bRawTX = false
 
static const int txRestrictionsRules [][3]
 
static boost::once_flag mp_debugPrintInitFlag = BOOST_ONCE_INIT
 
static FILE * fileout = NULL
 
static boost::mutex * mutexDebugLog = NULL
 
CCriticalSection cs_tally
 
static PendingMap my_pending
 
static char const *const statePrefix [NUM_FILETYPES]
 

Function Documentation

uint64_t calculate_and_update_devmsc ( unsigned int  nTime)

Definition at line 910 of file mastercore.cpp.

References BALANCE, exodus_address, exodus_prev, OMNI_PROPERTY_MSC, mastercore::rounduint64(), and mastercore::update_tally_map().

Referenced by mastercore_handler_block_end().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void calculateFundraiser ( unsigned short int  propType,
uint64_t  amtTransfer,
unsigned char  bonusPerc,
uint64_t  fundraiserSecs,
uint64_t  currentSecs,
uint64_t  numProps,
unsigned char  issuerPerc,
uint64_t  totalTokens,
std::pair< uint64_t, uint64_t > &  tokens,
bool &  close_crowdsale 
)

Definition at line 740 of file mastercore.cpp.

References MAX_INT_8_BYTES.

Referenced by CMPTransaction::logicMath_SimpleSend().

+ Here is the caller graph for this function:

static void clear_all_state ( )
static

Definition at line 2395 of file mastercore.cpp.

References mastercore::_my_sps, CMPSPInfo::clear(), exodus_prev, mastercore::mp_tally_map, mastercore::my_accepts, mastercore::my_crowds, and mastercore::my_offers.

Referenced by mastercore_handler_block_begin(), and mastercore_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const std::string ExodusAddress ( )

Definition at line 4085 of file mastercore.cpp.

References exodus_address.

Referenced by CMPSPInfo::CMPSPInfo().

+ Here is the caller graph for this function:

int64_t feeCheck ( const string &  address)

Definition at line 2733 of file mastercore.cpp.

References selectCoins().

Referenced by SendMPDialog::updateFrom().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string FormatDivisibleMP ( int64_t  n,
bool  fSign 
)

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().

+ Here is the caller graph for this function:

std::string FormatMP ( unsigned int  property,
int64_t  n,
bool  fSign 
)

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int64_t GetDustLimit ( const CScript scriptPubKey)

Definition at line 2644 of file mastercore.cpp.

References GetSerializeSize(), CTransaction::nMinRelayTxFee, and SER_DISK.

Referenced by mastercore::ClassB_send().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int64_t getMPbalance ( const string &  Address,
unsigned int  property,
TallyType  ttype 
)
static bool getOutputType ( const CScript scriptPubKey,
txnouttype whichTypeRet 
)
static

Definition at line 1012 of file mastercore.cpp.

References Solver().

Referenced by parseTransaction().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int input_globals_state_string ( const string &  s)

Definition at line 1837 of file mastercore.cpp.

References mastercore::_my_sps, exodus_prev, and CMPSPInfo::init().

Referenced by msc_file_load().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int input_mp_accepts_string ( const string &  s)

Definition at line 1803 of file mastercore.cpp.

References atoi(), mastercore::my_accepts, and STR_ACCEPT_ADDR_PROP_ADDR_COMBO.

Referenced by msc_file_load().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int input_mp_crowdsale_string ( const string &  s)

Definition at line 1856 of file mastercore.cpp.

References atoi(), and mastercore::my_crowds.

Referenced by msc_file_load().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int input_mp_offers_string ( const string &  s)

Definition at line 1725 of file mastercore.cpp.

References atoi(), mastercore::get_Indexes(), mastercore::get_Prices(), mastercore::metadex, METADEX_ERROR, mastercore::my_offers, OMNI_PROPERTY_BTC, and STR_SELLOFFER_ADDR_PROP_COMBO.

Referenced by msc_file_load().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int input_msc_balances_string ( const string &  s)

Definition at line 1661 of file mastercore.cpp.

References ACCEPT_RESERVE, atoi(), BALANCE, METADEX_RESERVE, OMNI_PROPERTY_MSC, SELLOFFER_RESERVE, and mastercore::update_tally_map().

Referenced by msc_file_load().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool is_state_prefix ( std::string const &  str)
static

Definition at line 2309 of file mastercore.cpp.

References NUM_FILETYPES.

Referenced by prune_state_files().

+ Here is the caller graph for this function:

static bool isAllowedOutputType ( int  whichType,
int  nBlock 
)
static

Definition at line 1048 of file mastercore.cpp.

References isNonMainNet(), P2SH_BLOCK, TX_PUBKEYHASH, and TX_SCRIPTHASH.

Referenced by parseTransaction().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool isMultiplicationOK ( const uint64_t  a,
const uint64_t  b 
)

Definition at line 477 of file mastercore.cpp.

References MAX_INT_8_BYTES.

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool isNonMainNet ( )

Definition at line 319 of file mastercore.cpp.

References RegTest(), and TestNet().

Referenced by isAllowedOutputType(), mastercore::isTransactionTypeAllowed(), mastercore_handler_block_begin(), mastercore_init(), NotificationAddress(), parseTransaction(), and TXExodusFundraiser().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool isRangeOK ( const uint64_t  input)
static

Definition at line 468 of file mastercore.cpp.

References MAX_INT_8_BYTES.

Referenced by mastercore::send_INTERNAL_1packet().

+ Here is the caller graph for this function:

static int load_most_relevant_state ( )
static

Definition at line 2036 of file mastercore.cpp.

References mastercore::_my_sps, chainActive, CChain::Contains(), tinyformat::detail::format(), CBlockIndex::GetBlockHash(), CMPSPInfo::getWatermark(), mapBlockIndex, MPPersistencePath, msc_file_load(), CBlockIndex::nHeight, NUM_FILETYPES, CBlockIndex::phashBlock, CMPSPInfo::popBlock(), CBlockIndex::pprev, base_uint< BITS >::SetHex(), CMPSPInfo::setWatermark(), and base_uint< BITS >::ToString().

Referenced by mastercore_handler_block_begin(), and mastercore_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mastercore_handler_block_begin ( int  nBlockPrev,
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 ConnectTip(), and msc_initial_scan().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mastercore_handler_block_end ( int  nBlockNow,
CBlockIndex const *  pBlockIndex,
unsigned int  countMP 
)

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 ConnectTip(), and msc_initial_scan().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mastercore_handler_disc_begin ( int  nBlockNow,
CBlockIndex const *  pBlockIndex 
)

Definition at line 4074 of file mastercore.cpp.

References CBlockIndex::nHeight, and reorgRecoveryMaxHeight.

Referenced by DisconnectTip().

+ Here is the caller graph for this function:

int mastercore_handler_disc_end ( int  nBlockNow,
CBlockIndex const *  pBlockIndex 
)

Definition at line 4081 of file mastercore.cpp.

Referenced by DisconnectTip().

+ Here is the caller graph for this function:

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 ConnectTip(), and msc_initial_scan().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 AppInit2(), mastercore_handler_block_end(), and mastercore_handler_tx().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mastercore_shutdown ( void  )

Definition at line 2540 of file mastercore.cpp.

References mastercore::_my_sps, DateTimeStrFormat(), GetTime(), mastercore::p_txlistdb, mastercore::s_stolistdb, and mastercore::t_tradelistdb.

Referenced by Shutdown().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mp_DebugPrintInit ( )
static

Definition at line 192 of file mastercore.cpp.

References fileout, GetDataDir(), LOG_FILENAME, and mutexDebugLog.

Referenced by mp_LogPrintStr().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

+ Here is the call graph for this function:

static int msc_file_load ( const string &  filename,
int  what,
bool  verifyHash = false 
)
static

Definition at line 1914 of file mastercore.cpp.

References FILETYPE_ACCEPTS, FILETYPE_BALANCES, FILETYPE_CROWDSALES, FILETYPE_GLOBALS, FILETYPE_OFFERS, input_globals_state_string(), input_mp_accepts_string(), input_mp_crowdsale_string(), input_mp_offers_string(), input_msc_balances_string(), LogPrintf, mastercore::metadex, mastercore::mp_tally_map, mastercore::my_accepts, mastercore::my_crowds, mastercore::my_offers, and base_uint< BITS >::ToString().

Referenced by load_most_relevant_state().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int msc_initial_scan ( int  nHeight)

Definition at line 1610 of file mastercore.cpp.

References chainActive, CBlockIndex::GetBlockHash(), mastercore::GetHeight(), base_uint< BITS >::GetHex(), mastercore_handler_block_begin(), mastercore_handler_block_end(), mastercore_handler_tx(), mastercore::mp_tally_map, ReadBlockFromDisk(), and CBlock::vtx.

Referenced by mastercore_handler_block_begin(), and mastercore_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const std::string NotificationAddress ( )

Definition at line 4090 of file mastercore.cpp.

References isNonMainNet().

+ Here is the call graph for this function:

std::string p128 ( int128_t  quantity)

Definition at line 728 of file mastercore.cpp.

std::string p_arb ( cpp_int  quantity)

Definition at line 733 of file mastercore.cpp.

int parseTransaction ( bool  bRPConly,
const CTransaction wtx,
int  nBlock,
unsigned int  idx,
CMPTransaction mp_tx,
unsigned int  nTime 
)
static int pendingAdd ( const uint256 txid,
const string &  FromAddress,
unsigned int  propId,
int64_t  Amount 
)
static

Definition at line 402 of file mastercore.cpp.

References CMPPending::amount, base_uint< BITS >::GetHex(), my_pending, PENDING, CMPPending::print(), CMPPending::prop, CMPPending::src, and mastercore::update_tally_map().

Referenced by mastercore::send_INTERNAL_1packet().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static CMPPending* pendingDelete ( const uint256  txid,
bool  bErase = false 
)
static

Definition at line 367 of file mastercore.cpp.

References CMPPending::amount, base_uint< BITS >::GetHex(), getMPbalance(), my_pending, PENDING, CMPPending::print(), CMPPending::prop, CMPPending::src, and mastercore::update_tally_map().

Referenced by mastercore_handler_tx().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void prepareObfuscatedHashes ( const string &  address,
string(&)  ObfsHashes[1+MAX_SHA256_OBFUSCATION_TIMES] 
)
static

Definition at line 990 of file mastercore.cpp.

References HexStr(), MAX_SHA256_OBFUSCATION_TIMES, and memcpy().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void prune_state_files ( CBlockIndex const *  topIndex)
static

Definition at line 2320 of file mastercore.cpp.

References tinyformat::detail::format(), is_state_prefix(), mapBlockIndex, MAX_STATE_HISTORY, MPPersistencePath, CBlockIndex::nHeight, NUM_FILETYPES, base_uint< BITS >::SetHex(), and CBlockIndex::ToString().

Referenced by mastercore_save_state().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool readPersistence ( )
static

Definition at line 246 of file mastercore.cpp.

Referenced by mastercore_handler_block_begin(), and mastercore_init().

+ Here is the caller graph for this function:

static int64_t selectCoins ( const string &  FromAddress,
CCoinControl coinControl,
int64_t  additional 
)
static

Definition at line 2663 of file mastercore.cpp.

References COIN, CWallet::cs_wallet, ExtractDestination(), CWalletTx::GetAvailableCredit(), IsMine(), CWallet::IsSpent(), CWalletTx::IsTrusted(), LOCK, CWallet::mapWallet, pwalletMain, CCoinControl::Select(), CBase58Data::ToString(), base_uint< BITS >::ToString(), and CTransaction::vout.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void shrinkDebugFile ( )
static

Definition at line 266 of file mastercore.cpp.

References GetDataDir(), and LOG_FILENAME.

Referenced by mastercore_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int TXExodusFundraiser ( const CTransaction wtx,
const string &  sender,
int64_t  ExodusHighestValue,
int  nBlock,
unsigned int  nTime 
)

Definition at line 1022 of file mastercore.cpp.

References BALANCE, COIN, exodus_address, GENESIS_BLOCK, CTransaction::GetHash(), isNonMainNet(), LAST_EXODUS_BLOCK, OMNI_PROPERTY_MSC, OMNI_PROPERTY_TMSC, base_uint< BITS >::ToString(), and mastercore::update_tally_map().

Referenced by parseTransaction().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int write_globals_state ( ofstream &  file,
SHA256_CTX *  shaCtx 
)
static

Definition at line 2231 of file mastercore.cpp.

References mastercore::_my_sps, exodus_prev, tinyformat::detail::format(), OMNI_PROPERTY_MSC, OMNI_PROPERTY_TMSC, and CMPSPInfo::peekNextSPID().

Referenced by write_state_file().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int write_mp_accepts ( ofstream &  file,
SHA256_CTX *  shaCtx 
)
static

Definition at line 2217 of file mastercore.cpp.

References mastercore::my_accepts, and CMPAccept::saveAccept().

Referenced by write_state_file().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int write_mp_crowdsales ( ofstream &  file,
SHA256_CTX *  shaCtx 
)
static

Definition at line 2250 of file mastercore.cpp.

References mastercore::my_crowds, and CMPCrowd::saveCrowdSale().

Referenced by write_state_file().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int write_mp_metadex ( ofstream &  file,
SHA256_CTX *  shaCtx 
)
static

Definition at line 2198 of file mastercore.cpp.

References mastercore::metadex, and CMPMetaDEx::saveOffer().

Referenced by write_state_file().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int write_mp_offers ( ofstream &  file,
SHA256_CTX *  shaCtx 
)
static

Definition at line 2183 of file mastercore.cpp.

References mastercore::my_offers, and CMPOffer::saveOffer().

Referenced by write_state_file().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int write_msc_balances ( ofstream &  file,
SHA256_CTX *  shaCtx 
)
static

Definition at line 2135 of file mastercore.cpp.

References ACCEPT_RESERVE, BALANCE, tinyformat::detail::format(), CMPTally::init(), LOCK, METADEX_RESERVE, mastercore::mp_tally_map, CMPTally::next(), and SELLOFFER_RESERVE.

Referenced by write_state_file().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int write_state_file ( CBlockIndex const *  pBlockIndex,
int  what 
)
static

Definition at line 2262 of file mastercore.cpp.

References FILETYPE_ACCEPTS, FILETYPE_BALANCES, FILETYPE_CROWDSALES, FILETYPE_GLOBALS, FILETYPE_OFFERS, tinyformat::detail::format(), CBlockIndex::GetBlockHash(), MPPersistencePath, base_uint< BITS >::ToString(), write_globals_state(), write_mp_accepts(), write_mp_crowdsales(), write_mp_metadex(), write_mp_offers(), and write_msc_balances().

Referenced by mastercore_save_state().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool writePersistence ( int  block_now)
static

Definition at line 257 of file mastercore.cpp.

References mastercore::GetHeight(), and MAX_STATE_HISTORY.

Referenced by mastercore_handler_block_end().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

bool bRawTX = false
static

Definition at line 133 of file mastercore.cpp.

Referenced by mastercore::ClassB_send().

CCriticalSection cs_tally
const int disable_Divs = 0
static

Definition at line 125 of file mastercore.cpp.

const int disableLevelDB = 0
static

Definition at line 126 of file mastercore.cpp.

string exodus_address = "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P"
static
uint64_t exodus_balance
static

Definition at line 98 of file mastercore.cpp.

Referenced by mastercore_init().

uint64_t exodus_prev = 0
static
const string exodus_testnet = "mpexoDuSkGGqvqrkrjiFng38QPkJQVFyqv"
static

Definition at line 68 of file mastercore.cpp.

Referenced by mastercore_init().

FILE* fileout = NULL
static
const string getmoney_testnet = "moneyqMan7uh8FqdCA2BV5yZ8qVrc9ikLP"
static

Definition at line 69 of file mastercore.cpp.

Referenced by parseTransaction().

string global_alert_message
uint64_t global_balance_money_maineco[100000]
uint64_t global_balance_money_testeco[100000]
uint64_t global_balance_reserved_maineco[100000]
uint64_t global_balance_reserved_testeco[100000]
uint64_t global_MSC_RESERVED_total = 0

Definition at line 89 of file mastercore.cpp.

uint64_t global_MSC_total = 0

Definition at line 88 of file mastercore.cpp.

int mastercoreInitialized = 0
static

Definition at line 128 of file mastercore.cpp.

Referenced by mastercore_init().

boost::once_flag mp_debugPrintInitFlag = BOOST_ONCE_INIT
static

Definition at line 186 of file mastercore.cpp.

Referenced by mp_LogPrintStr().

boost::filesystem::path MPPersistencePath
static
const int msc_debug_dex = 1
const int msc_debug_exo = 0

Definition at line 113 of file mastercore.cpp.

Referenced by mastercore::update_tally_map().

int msc_debug_metadex1 = 0

Definition at line 121 of file mastercore.cpp.

int msc_debug_metadex2 = 0

Definition at line 122 of file mastercore.cpp.

int msc_debug_metadex3 = 0

Definition at line 123 of file mastercore.cpp.

const int msc_debug_parser = 0

Definition at line 103 of file mastercore.cpp.

const int msc_debug_parser_data = 0

Definition at line 102 of file mastercore.cpp.

const int msc_debug_persistence = 0

Definition at line 119 of file mastercore.cpp.

const int msc_debug_script = 0

Definition at line 108 of file mastercore.cpp.

const int msc_debug_send = 1

Definition at line 110 of file mastercore.cpp.

const int msc_debug_sp = 1

Definition at line 115 of file mastercore.cpp.

const int msc_debug_spec = 1

Definition at line 112 of file mastercore.cpp.

const int msc_debug_sto = 1

Definition at line 116 of file mastercore.cpp.

const int msc_debug_tally = 1

Definition at line 114 of file mastercore.cpp.

const int msc_debug_tokens = 0

Definition at line 111 of file mastercore.cpp.

const int msc_debug_tradedb = 1

Definition at line 118 of file mastercore.cpp.

const int msc_debug_txdb = 0

Definition at line 117 of file mastercore.cpp.

const int msc_debug_verbose =0

Definition at line 104 of file mastercore.cpp.

const int msc_debug_verbose2 =0

Definition at line 105 of file mastercore.cpp.

const int msc_debug_verbose3 =0

Definition at line 106 of file mastercore.cpp.

const int msc_debug_vin = 0

Definition at line 107 of file mastercore.cpp.

boost::mutex* mutexDebugLog = NULL
static

Definition at line 190 of file mastercore.cpp.

Referenced by mp_DebugPrintInit(), and mp_LogPrintStr().

PendingMap my_pending
static

Definition at line 365 of file mastercore.cpp.

Referenced by pendingAdd(), and pendingDelete().

const int nBlockTop = 0
static

Definition at line 83 of file mastercore.cpp.

Referenced by mastercore::GetHeight().

int nWaterlineBlock = 0
static

Definition at line 86 of file mastercore.cpp.

int reorgRecoveryMaxHeight = 0
static

Definition at line 131 of file mastercore.cpp.

Referenced by mastercore_handler_disc_begin().

int reorgRecoveryMode = 0
static

Definition at line 130 of file mastercore.cpp.

char const* const statePrefix[NUM_FILETYPES]
static
Initial value:
= {
"balances",
"offers",
"accepts",
"globals",
"crowdsales",
}

Definition at line 2027 of file mastercore.cpp.

const int txRestrictionsRules[][3]
static
Initial value:
= {
{-1,-1},
}
#define MP_TX_PKT_V0
Definition: mastercore.h:41
#define MP_TX_PKT_V1
Definition: mastercore.h:42

Definition at line 136 of file mastercore.cpp.

Referenced by mastercore::isTransactionTypeAllowed().