@@ -30,13 +30,12 @@ class CMPMetaDEx
3030private:
3131 int block;
3232 uint256 txid;
33- // ! Index within the block
34- unsigned int idx;
35- unsigned int property;
36- uint64_t amount_forsale;
37- unsigned int desired_property;
33+ unsigned int idx; // index within block
34+ uint32_t property;
35+ int64_t amount_forsale;
36+ uint32_t desired_property;
3837 int64_t amount_desired;
39- uint64_t still_left_forsale ;
38+ int64_t amount_remaining ;
4039 unsigned char subaction;
4140 std::string addr;
4241
@@ -47,8 +46,9 @@ class CMPMetaDEx
4746 unsigned int getProperty () const { return property; }
4847 unsigned int getDesProperty () const { return desired_property; }
4948
50- uint64_t getAmountForSale () const { return amount_forsale; }
49+ int64_t getAmountForSale () const { return amount_forsale; }
5150 int64_t getAmountDesired () const { return amount_desired; }
51+ int64_t getAmountRemaining () const { return amount_remaining; }
5252
5353 void setAmountForSale (int64_t ao, const std::string& label = " " )
5454 {
@@ -62,6 +62,12 @@ class CMPMetaDEx
6262 file_log (" %s(%ld %s):%s\n " , __FUNCTION__, ad, label, ToString ());
6363 }
6464
65+ void setAmountRemaining (int64_t ar, const std::string& label = " " )
66+ {
67+ amount_remaining = ar;
68+ file_log (" %s(%ld %s):%s\n " , __FUNCTION__, ar, label, ToString ());
69+ }
70+
6571 unsigned char getAction () const { return subaction; }
6672
6773 const std::string& getAddr () const { return addr; }
@@ -79,14 +85,14 @@ class CMPMetaDEx
7985 // needed only by the RPC functions
8086 CMPMetaDEx ()
8187 : block(0 ), txid(0 ), idx(0 ), property(0 ), amount_forsale(0 ), desired_property(0 ), amount_desired(0 ),
82- still_left_forsale (0 ), subaction(0 ) {}
88+ amount_remaining (0 ), subaction(0 ) {}
8389
84- CMPMetaDEx (const std::string& addr, int b, unsigned int c, uint64_t nValue, unsigned int cd, uint64_t ad,
85- const uint256& tx, unsigned int i, unsigned char suba, uint64_t lfors = 0 )
90+ CMPMetaDEx (const std::string& addr, int b, uint32_t c, int64_t nValue, uint32_t cd, int64_t ad,
91+ const uint256& tx, uint32_t i, unsigned char suba, int64_t ar = 0 )
8692 : block(b), txid(tx), idx(i), property(c), amount_forsale(nValue), desired_property(cd), amount_desired(ad),
87- still_left_forsale(lfors ), subaction(suba), addr(addr) {}
93+ amount_remaining(ar ), subaction(suba), addr(addr) {}
8894
89- void Set (const std::string&, int , unsigned int , uint64_t , unsigned int , uint64_t , const uint256&, unsigned int , unsigned char );
95+ void Set (const std::string&, int , uint32_t , int64_t , uint32_t , int64_t , const uint256&, uint32_t , unsigned char );
9096
9197 std::string ToString () const ;
9298
@@ -109,19 +115,19 @@ typedef std::set<CMPMetaDEx, MetaDEx_compare> md_Set;
109115// ! Map of prices; there is a set of sorted objects for each price
110116typedef std::map<XDOUBLE, md_Set> md_PricesMap;
111117// ! Map of properties; there is a map of prices for each property
112- typedef std::map<unsigned int , md_PricesMap> md_PropertiesMap;
118+ typedef std::map<uint32_t , md_PricesMap> md_PropertiesMap;
113119
114120extern md_PropertiesMap metadex;
115121
116122// TODO: explore a property-pair, instead of a single property as map's key........
117- md_PricesMap* get_Prices (unsigned int prop);
123+ md_PricesMap* get_Prices (uint32_t prop);
118124md_Set* get_Indexes (md_PricesMap* p, XDOUBLE price);
119125// ---------------
120126
121- int MetaDEx_ADD (const std::string& sender_addr, unsigned int , uint64_t , int block, unsigned int property_desired, uint64_t amount_desired, const uint256& txid, unsigned int idx);
122- int MetaDEx_CANCEL_AT_PRICE (const uint256&, unsigned int , const std::string&, unsigned int , uint64_t , unsigned int , uint64_t );
123- int MetaDEx_CANCEL_ALL_FOR_PAIR (const uint256&, unsigned int , const std::string&, unsigned int , unsigned int );
124- int MetaDEx_CANCEL_EVERYTHING (const uint256& txid, unsigned int block, const std::string& sender_addr, unsigned char ecosystem);
127+ int MetaDEx_ADD (const std::string& sender_addr, uint32_t , int64_t , int block, uint32_t property_desired, int64_t amount_desired, const uint256& txid, unsigned int idx);
128+ int MetaDEx_CANCEL_AT_PRICE (const uint256&, uint32_t , const std::string&, uint32_t , int64_t , uint32_t , int64_t );
129+ int MetaDEx_CANCEL_ALL_FOR_PAIR (const uint256&, uint32_t , const std::string&, uint32_t , uint32_t );
130+ int MetaDEx_CANCEL_EVERYTHING (const uint256& txid, uint32_t block, const std::string& sender_addr, unsigned char ecosystem);
125131
126132void MetaDEx_debug_print (bool bShowPriceLevel = false , bool bDisplay = false );
127133}
0 commit comments