Skip to content

Commit

Permalink
MetaDEx UI: clean up after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
zathras-crypto committed May 7, 2015
1 parent f3c9905 commit 9dd79ed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
5 changes: 0 additions & 5 deletions src/mastercore_errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ enum MPRPCErrorCode
MP_INSUF_FUNDS_BPENDI = -1, // balance before pending
MP_INSUF_FUNDS_APENDI = -2, // balance after pending
MP_INPUT_NOT_IN_RANGE = -11, // input value larger than supported
<<<<<<< HEAD

//ClassAgnosticWalletTXBuilder(
=======

//ClassAgnostic_send
>>>>>>> 095fd7e16d56db43f050013d6f30d8b35b6a31df
MP_INPUTS_INVALID = -212,
MP_ENCODING_ERROR = -250,
MP_REDEMP_ILLEGAL = -233,
Expand Down
8 changes: 4 additions & 4 deletions src/qt/metadexcanceldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void MetaDExCancelDialog::UpdateCancelCombo()
if (isBuy) {
if (!divisible) price = price/COIN;
} else {
if (!divisible) { price = obj.effectivePrice()/COIN; } else { price = obj.effectivePrice(); }
if (!divisible) { price = obj.unitPrice()/COIN; } else { price = obj.unitPrice(); }
}
comboStr += " priced at " + StripTrailingZeros(price.str(16, std::ios_base::fixed)); // limited to 16 digits of precision for display purposes
if ((obj.getProperty() == OMNI_PROPERTY_MSC) || (obj.getDesProperty() == OMNI_PROPERTY_MSC)) { comboStr += " MSC/SPT"; } else { comboStr += " TMSC/SPT"; }
Expand Down Expand Up @@ -277,15 +277,15 @@ void MetaDExCancelDialog::SendCancelTransaction()
md_PricesMap & prices = my_it->second;
for (md_PricesMap::iterator it = prices.begin(); it != prices.end(); ++it) {
XDOUBLE price = it->first;
XDOUBLE effectivePrice;
XDOUBLE unitPrice;
md_Set & indexes = it->second;
for (md_Set::iterator it = indexes.begin(); it != indexes.end(); ++it) {
CMPMetaDEx obj = *it;
effectivePrice = obj.effectivePrice();
unitPrice = obj.unitPrice();
if ((propertyIdForSale == OMNI_PROPERTY_MSC) || (propertyIdForSale == OMNI_PROPERTY_TMSC)) { // "buy" order
if (price.str(DISPLAY_PRECISION_LEN, std::ios_base::fixed) == priceStr) matched=true;
} else {
if (effectivePrice.str(DISPLAY_PRECISION_LEN, std::ios_base::fixed) == priceStr) matched=true;
if (unitPrice.str(DISPLAY_PRECISION_LEN, std::ios_base::fixed) == priceStr) matched=true;
}
if (matched) {
amountForSale = obj.getAmountForSale();
Expand Down
10 changes: 5 additions & 5 deletions src/qt/metadexdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ void MetaDExDialog::UpdateOffers()
md_PricesMap & prices = my_it->second;
for (md_PricesMap::iterator it = prices.begin(); it != prices.end(); ++it) { // loop through the sell prices for the property
XDOUBLE price = (it->first);
XDOUBLE effectivePrice;
string effectivePriceStr;
XDOUBLE unitPrice;
string unitPriceStr;
int64_t available = 0, total = 0;
bool includesMe = false;
md_Set & indexes = (it->second);
Expand All @@ -267,19 +267,19 @@ void MetaDExDialog::UpdateOffers()
if(IsMyAddress(obj.getAddr())) includesMe = true;
}
}
effectivePrice = obj.effectivePrice(); // could be set multiple times but always a same price level
unitPrice = obj.unitPrice(); // could be set multiple times but always a same price level
}
if ((available > 0) && (total > 0)) { // if there are any available at this price, add to the sell list
string strAvail;
if (isPropertyDivisible(global_metadex_market)) { strAvail = FormatDivisibleShortMP(available); } else { strAvail = FormatIndivisibleMP(available); }

if ((!isPropertyDivisible(global_metadex_market)) && (useBuyList)) { price = price/COIN; }
if ((!isPropertyDivisible(global_metadex_market)) && (!useBuyList)) { effectivePrice = effectivePrice/COIN; }
if ((!isPropertyDivisible(global_metadex_market)) && (!useBuyList)) { unitPrice = unitPrice/COIN; }

if (useBuyList) {
AddRow(useBuyList, includesMe, StripTrailingZeros(price.str(DISPLAY_PRECISION_LEN, std::ios_base::fixed)), strAvail, FormatDivisibleShortMP(total));
} else {
AddRow(useBuyList, includesMe, StripTrailingZeros(effectivePrice.str(DISPLAY_PRECISION_LEN, std::ios_base::fixed)), strAvail, FormatDivisibleShortMP(total));
AddRow(useBuyList, includesMe, StripTrailingZeros(unitPrice.str(DISPLAY_PRECISION_LEN, std::ios_base::fixed)), strAvail, FormatDivisibleShortMP(total));
}
}
}
Expand Down

0 comments on commit 9dd79ed

Please sign in to comment.