mastercoin-MSC / mastercore

mastercore info
mastercoin.org
MIT License
24 stars 11 forks source link

Sort trade offers and replace add_mdex_fields #201

Closed dexX7 closed 9 years ago

dexX7 commented 9 years ago

This is the continuation of @faizkhan00's #197.

The result of getorderbook_MP, gettradessince_MP and gettradehistory_MP is sorted based on block height and position of a transaction within a block by using the MetaDEx_compare comparator.

This further replaces void add_mdex_fields(Object *metadex_obj, CMPMetaDEx obj, bool c_own_div, bool c_want_div, string eco) with:

void MetaDexObjectToJSON(const CMPMetaDEx& obj, Object& metadex_obj)
void MetaDexObjectsToJSON(std::vector<CMPMetaDEx> vMetaDexObjs, Array& response)

I did not include the code / style format, but I'd be happy to push it, once this is merged.