Closed zathras-crypto closed 9 years ago
That's pretty awesome. Will start some tests in a few minutes.
Sidenote: git rebase -i HEAD~26
can be used to combine (stash) some commits for easier code review (e.g. grouped into persistence, rpc, ...). Overwriting already pushed stuff is possible with -f
in git push remotename -f branchname
. That's of course no demand to do so, but might be useful from time to time. :)
this looks good to me ... @m21 to expedite ? so we can have usable functionality for the rest of the RPCs
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: http://stackoverflow.com/questions/7959573/declaring-variables-inside-loops-good-practice-or-bad-practice-2-parter
@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
1) gettransaction_MP now works for any metadex order not just open ones 2) populateRPCTransactionObject now parses off the wire for metadex just like all other types 3) new levelDB MP_tradelist 4) every completed trade added to tradelistDB with txids, addresses, properties, and amounts 5) new gettrade_MP call added 6) gettrade_MP will iter metadex map to determine if offer still active 7) new getMatchedTrades function added using tradelistDB to return all trades matched with a supplied txid 8) gettrade_MP will call getMatchedTrades and supply to user over RPC 9) mscrpc 7 function to dump tradelistDB
example http://pastie.org/pastes/9698921/text?key=a5n5cqglbd80c7tfytwgxw