-
Notifications
You must be signed in to change notification settings - Fork 8
Add trade history levelDB, trade_MP call, clean up MetaDex populateRPCTransactionObject #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused, can be removed.
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