remove unused fields from TradePeer and Contract

fix concurrent modification exception applying prices to trade stats
standardize offer fee tx ids (unused)
This commit is contained in:
woodser 2023-03-09 13:00:49 -05:00
parent a16b03bb5c
commit 47f3d98597
28 changed files with 60 additions and 108 deletions

View file

@ -31,7 +31,7 @@ class TransactionAwareOpenOffer implements TransactionAwareTradable {
public boolean isRelatedToTransaction(MoneroTxWallet transaction) {
Offer offer = delegate.getOffer();
String paymentTxId = offer.getOfferFeePaymentTxId();
String paymentTxId = offer.getOfferFeeTxId();
String txId = transaction.getHash();

View file

@ -91,7 +91,7 @@ class TransactionAwareTrade implements TransactionAwareTradable {
private boolean isOfferFeeTx(String txId) {
return Optional.ofNullable(trade.getOffer())
.map(Offer::getOfferFeePaymentTxId)
.map(Offer::getOfferFeeTxId)
.map(paymentTxId -> paymentTxId.equals(txId))
.orElse(false);
}

View file

@ -116,8 +116,8 @@ class TransactionsListItem {
Trade trade = (Trade) tradable;
Offer offer = trade.getOffer();
String offerFeePaymentTxID = offer.getOfferFeePaymentTxId();
if (offerFeePaymentTxID != null && offerFeePaymentTxID.equals(txId)) {
String offerFeeTxId = offer.getOfferFeeTxId();
if (offerFeeTxId != null && offerFeeTxId.equals(txId)) {
details = Res.get("funds.tx.createOfferFee", tradeId);
} else if (trade.getSelf().getDepositTxHash() != null &&
trade.getSelf().getDepositTxHash().equals(txId)) {

View file

@ -202,7 +202,7 @@ class TakeOfferDataModel extends OfferDataModel {
mempoolStatus.setValue(txValidator.isFail() ? 0 : 1);
if (txValidator.isFail()) {
mempoolStatusText = txValidator.toString();
log.info("Mempool check of OfferFeePaymentTxId returned errors: [{}]", mempoolStatusText);
log.info("Mempool check of OfferFeeTxId returned errors: [{}]", mempoolStatusText);
}
}));

View file

@ -192,7 +192,7 @@ class EditOfferDataModel extends MutableOfferDataModel {
newOfferPayload.getCounterCurrencyCode(),
newOfferPayload.getPaymentMethodId(),
newOfferPayload.getMakerPaymentAccountId(),
offerPayload.getOfferFeePaymentTxId(),
offerPayload.getOfferFeeTxId(),
newOfferPayload.getCountryCode(),
newOfferPayload.getAcceptedCountryCodes(),
newOfferPayload.getBankId(),

View file

@ -325,7 +325,7 @@ public class FailedTradesView extends ActivatableViewAndModel<VBox, FailedTrades
if (model.getDirectionLabel(item).contains(filterString)) {
return true;
}
if (offer.getOfferFeePaymentTxId().contains(filterString)) {
if (offer.getOfferFeeTxId() != null && offer.getOfferFeeTxId().contains(filterString)) {
return true;
}

View file

@ -344,7 +344,7 @@ public class OpenOffersView extends ActivatableViewAndModel<VBox, OpenOffersView
if (model.getDirectionLabel(item).contains(filterString)) {
return true;
}
if (offer.getOfferFeePaymentTxId().contains(filterString)) {
if (offer.getOfferFeeTxId() != null && offer.getOfferFeeTxId().contains(filterString)) {
return true;
}
return false;

View file

@ -18,7 +18,6 @@
package haveno.desktop.util.filtering;
import haveno.core.offer.Offer;
import haveno.core.trade.Contract;
import haveno.core.trade.Trade;
import org.apache.commons.lang3.StringUtils;
@ -30,7 +29,7 @@ public class FilteringUtils {
if (StringUtils.containsIgnoreCase(offer.getPaymentMethod().getDisplayString(), filterString)) {
return true;
}
return offer.getOfferFeePaymentTxId() != null && StringUtils.containsIgnoreCase(offer.getOfferFeePaymentTxId(), filterString);
return offer.getOfferFeeTxId() != null && StringUtils.containsIgnoreCase(offer.getOfferFeeTxId(), filterString);
}
public static boolean match(Trade trade, String filterString) {