Add trade history levelDB, trade_MP call, clean up MetaDex populateRPCTransactionObject#194
Conversation
…nto 0.0.9-Z-MetaDExTradeHistory
…nto 0.0.9-Z-MetaDExTradeHistory Conflicts: src/mastercore_dex.h
|
That's pretty awesome. Will start some tests in a few minutes. Sidenote: |
There was a problem hiding this comment.
#182 could remove a lot of those. But there is also:
std::string FormatMP(unsigned int propertyid, int64_t n, bool fSign)There was a problem hiding this comment.
Looks like a duplication of mastercore_rpc.cpp#L1921-L1947.
Maybe replace by something like:
void evaluatePopulationStatus(int nResult)
{
switch (nResult) {
case MP_TX_NOT_FOUND:
throw ...
...
}
}|
this looks good to me ... @m21 to expedite ? so we can have usable functionality for the rest of the RPCs |
Add trade history levelDB, trade_MP call, clean up MetaDex populateRPCTransactionObject
|
Tested a few transactions, works great! I posted some comments inline. The only thing I'm really not sure about is mastercore_rpc.cpp#L2125-L2133: for (md_PricesMap::iterator it = prices.begin(); it != prices.end(); ++it)
{
md_Set & indexes = (it->second);
for (md_Set::iterator it = indexes.begin(); it != indexes.end(); ++it)
{
CMPMetaDEx obj = *it;
if( obj.getHash().GetHex() == hash.GetHex() ) orderOpen = true;
}
}Declaring variables multiple times seems to be legal, but how do you get away with it? The iterator it is declared two times here and both loops modify it. |
|
They are local to the for-loops Dexx: |
|
@m21: the link doesn't really nail it, but it makes sense and works. Interesting realization for me.. :) See this example: http://ideone.com/pc8h37 |
example
http://pastie.org/pastes/9698921/text?key=a5n5cqglbd80c7tfytwgxw