Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Namespaces | Macros | Typedefs | Functions | Variables
mastercore_dex.h File Reference
#include "mastercore.h"
#include <boost/multiprecision/cpp_dec_float.hpp>
+ Include dependency graph for mastercore_dex.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CMPOffer
 
class  CMPAccept
 
class  CMPMetaDEx
 
class  mastercore::MetaDEx_compare
 

Namespaces

 mastercore
 

Macros

#define STR_SELLOFFER_ADDR_PROP_COMBO(x)   ( x + "-" + strprintf("%d", prop))
 
#define STR_ACCEPT_ADDR_PROP_ADDR_COMBO(_seller, _buyer)   ( _seller + "-" + strprintf("%d", prop) + "+" + _buyer)
 
#define STR_PAYMENT_SUBKEY_TXID_PAYMENT_COMBO(txidStr)   ( txidStr + "-" + strprintf("%d", paymentNumber))
 
#define STR_REF_SUBKEY_TXID_REF_COMBO(txidStr)   ( txidStr + strprintf("%d", refNumber))
 
#define DISPLAY_PRECISION_LEN   50
 
#define INTERNAL_PRECISION_LEN   50
 

Typedefs

typedef cpp_dec_float_100 XDOUBLE
 
typedef std::map< string, CMPOffermastercore::OfferMap
 
typedef std::map< string, CMPAcceptmastercore::AcceptMap
 
typedef std::pair< uint64_t, uint64_t > mastercore::MetaDExTypePrice
 
typedef std::set< CMPMetaDEx, MetaDEx_compare > mastercore::md_Set
 
typedef std::map< XDOUBLE, md_Set > mastercore::md_PricesMap
 
typedef std::map< unsigned int, md_PricesMap > mastercore::md_PropertiesMap
 

Functions

unsigned int eraseExpiredAccepts (int blockNow)
 
bool mastercore::DEx_offerExists (const string &seller_addr, unsigned int)
 
CMPOffermastercore::DEx_getOffer (const string &seller_addr, unsigned int)
 
CMPAcceptmastercore::DEx_getAccept (const string &seller_addr, unsigned int, const string &buyer_addr)
 
int mastercore::DEx_offerCreate (string seller_addr, unsigned int, uint64_t nValue, int block, uint64_t amount_desired, uint64_t fee, unsigned char btl, const uint256 &txid, uint64_t *nAmended=NULL)
 
int mastercore::DEx_offerDestroy (const string &seller_addr, unsigned int)
 
int mastercore::DEx_offerUpdate (const string &seller_addr, unsigned int, uint64_t nValue, int block, uint64_t desired, uint64_t fee, unsigned char btl, const uint256 &txid, uint64_t *nAmended=NULL)
 
int mastercore::DEx_acceptCreate (const string &buyer, const string &seller, int, uint64_t nValue, int block, uint64_t fee_paid, uint64_t *nAmended=NULL)
 
int mastercore::DEx_acceptDestroy (const string &buyer, const string &seller, int, bool bForceErase=false)
 
int mastercore::DEx_payment (uint256 txid, unsigned int vout, string seller, string buyer, uint64_t BTC_paid, int blockNow, uint64_t *nAmended=NULL)
 
int mastercore::MetaDEx_ADD (const string &sender_addr, unsigned int, uint64_t, int block, unsigned int property_desired, uint64_t amount_desired, const uint256 &txid, unsigned int idx)
 
int mastercore::MetaDEx_CANCEL_AT_PRICE (const uint256, unsigned int, const string &, unsigned int, uint64_t, unsigned int, uint64_t)
 
int mastercore::MetaDEx_CANCEL_ALL_FOR_PAIR (const uint256, unsigned int, const string &, unsigned int, unsigned int)
 
int mastercore::MetaDEx_CANCEL_EVERYTHING (const uint256, unsigned int, const string &)
 
md_PricesMapmastercore::get_Prices (unsigned int prop)
 
md_Setmastercore::get_Indexes (md_PricesMap *p, XDOUBLE price)
 
void mastercore::MetaDEx_debug_print (bool bShowPriceLevel=false, bool bDisplay=false)
 

Variables

OfferMap mastercore::my_offers
 
AcceptMap mastercore::my_accepts
 
md_PropertiesMap mastercore::metadex
 

Macro Definition Documentation

#define DISPLAY_PRECISION_LEN   50
#define INTERNAL_PRECISION_LEN   50

Definition at line 13 of file mastercore_dex.h.

Referenced by operator<=(), operator==(), operator>=(), and x_Trade().

#define STR_ACCEPT_ADDR_PROP_ADDR_COMBO (   _seller,
  _buyer 
)    ( _seller + "-" + strprintf("%d", prop) + "+" + _buyer)
#define STR_PAYMENT_SUBKEY_TXID_PAYMENT_COMBO (   txidStr)    ( txidStr + "-" + strprintf("%d", paymentNumber))

Definition at line 9 of file mastercore_dex.h.

Referenced by CMPTxList::recordPaymentTX().

#define STR_REF_SUBKEY_TXID_REF_COMBO (   txidStr)    ( txidStr + strprintf("%d", refNumber))

Definition at line 10 of file mastercore_dex.h.

Referenced by CMPTxList::recordMetaDExCancelTX().

#define STR_SELLOFFER_ADDR_PROP_COMBO (   x)    ( x + "-" + strprintf("%d", prop))

Typedef Documentation

typedef cpp_dec_float_100 XDOUBLE

Definition at line 172 of file mastercore_dex.h.

Function Documentation

unsigned int eraseExpiredAccepts ( int  blockNow)

Definition at line 711 of file mastercore_dex.cpp.

References atoi(), CMPAccept::block, mastercore::DEx_acceptDestroy(), CMPAccept::getBlockTimeLimit(), and mastercore::my_accepts.

Referenced by mastercore_handler_block_end().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: