Not expose offer fee tx id in UI or JSON export

This commit is contained in:
Christoph Atteneder 2020-01-29 14:50:09 +01:00
parent 2887ab0bc5
commit 1d9fda74b9
No known key found for this signature in database
GPG key ID: CD5DC1C529CDFD3B
3 changed files with 23 additions and 35 deletions

View file

@ -33,9 +33,8 @@ import bisq.common.handlers.ResultHandler;
import bisq.common.storage.JsonFileManager;
import bisq.common.util.Utilities;
import javax.inject.Named;
import javax.inject.Inject;
import javax.inject.Named;
import java.io.File;
@ -88,30 +87,26 @@ public class OfferBookService {
p2PService.addHashSetChangedListener(new HashMapChangedListener() {
@Override
public void onAdded(Collection<ProtectedStorageEntry> protectedStorageEntries) {
protectedStorageEntries.forEach(protectedStorageEntry -> {
offerBookChangedListeners.stream().forEach(listener -> {
protectedStorageEntries.forEach(protectedStorageEntry -> offerBookChangedListeners.forEach(listener -> {
if (protectedStorageEntry.getProtectedStoragePayload() instanceof OfferPayload) {
OfferPayload offerPayload = (OfferPayload) protectedStorageEntry.getProtectedStoragePayload();
Offer offer = new Offer(offerPayload);
offer.setPriceFeedService(priceFeedService);
listener.onAdded(offer);
}
});
});
}));
}
@Override
public void onRemoved(Collection<ProtectedStorageEntry> protectedStorageEntries) {
protectedStorageEntries.forEach(protectedStorageEntry -> {
offerBookChangedListeners.stream().forEach(listener -> {
protectedStorageEntries.forEach(protectedStorageEntry -> offerBookChangedListeners.forEach(listener -> {
if (protectedStorageEntry.getProtectedStoragePayload() instanceof OfferPayload) {
OfferPayload offerPayload = (OfferPayload) protectedStorageEntry.getProtectedStoragePayload();
Offer offer = new Offer(offerPayload);
offer.setPriceFeedService(priceFeedService);
listener.onRemoved(offer);
}
});
});
}));
}
});
@ -241,8 +236,7 @@ public class OfferBookService {
offer.getId(),
offer.isUseMarketBasedPrice(),
offer.getMarketPriceMargin(),
offer.getPaymentMethod(),
offer.getOfferFeePaymentTxId()
offer.getPaymentMethod()
);
} catch (Throwable t) {
// In case an offer was corrupted with null values we ignore it

View file

@ -35,6 +35,8 @@ import java.util.Date;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nullable;
public class OfferForJson {
private static final Logger log = LoggerFactory.getLogger(OfferForJson.class);
@ -48,7 +50,6 @@ public class OfferForJson {
public final double marketPriceMargin;
public final String paymentMethod;
public final String id;
public final String offerFeeTxID;
// primaryMarket fields are based on industry standard where primaryMarket is always in the focus (in the app BTC is always in the focus - will be changed in a larger refactoring once)
public String currencyPair;
@ -78,25 +79,23 @@ public class OfferForJson {
String currencyCode,
Coin minAmount,
Coin amount,
Price price,
@Nullable Price price,
Date date,
String id,
boolean useMarketBasedPrice,
double marketPriceMargin,
PaymentMethod paymentMethod,
String offerFeeTxID) {
PaymentMethod paymentMethod) {
this.direction = direction;
this.currencyCode = currencyCode;
this.minAmount = minAmount.value;
this.amount = amount.value;
this.price = price.getValue();
this.price = price != null ? price.getValue() : 0;
this.date = date.getTime();
this.id = id;
this.useMarketBasedPrice = useMarketBasedPrice;
this.marketPriceMargin = marketPriceMargin;
this.paymentMethod = paymentMethod.getId();
this.offerFeeTxID = offerFeeTxID;
setDisplayStrings();
}

View file

@ -301,8 +301,6 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
rows = 3;
if (countryCode != null)
rows++;
if (offer.getOfferFeePaymentTxId() != null)
rows++;
if (!isF2F)
rows++;
@ -326,9 +324,6 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("offerDetailsWindow.countryBank"),
CountryUtil.getNameAndCode(countryCode));
if (offer.getOfferFeePaymentTxId() != null)
addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.makerFeeTxId"), offer.getOfferFeePaymentTxId());
if (placeOfferHandlerOptional.isPresent()) {
addTitledGroupBg(gridPane, ++rowIndex, 1, Res.get("offerDetailsWindow.commitment"), Layout.GROUP_DISTANCE);
final Tuple2<Label, Label> labelLabelTuple2 = addConfirmationLabelLabel(gridPane, rowIndex, Res.get("offerDetailsWindow.agree"), Res.get("createOffer.tac"),