diff --git a/core/src/main/java/bisq/core/payment/AccountAgeRestrictions.java b/core/src/main/java/bisq/core/payment/AccountAgeRestrictions.java index 6458bc08ddb..85dd82cef34 100644 --- a/core/src/main/java/bisq/core/payment/AccountAgeRestrictions.java +++ b/core/src/main/java/bisq/core/payment/AccountAgeRestrictions.java @@ -32,7 +32,7 @@ @Slf4j public class AccountAgeRestrictions { - public static final long SAFE_ACCOUNT_AGE_DATE = Utilities.getUTCDate(2019, GregorianCalendar.MARCH, 15).getTime(); + public static final long SAFE_ACCOUNT_AGE_DATE = Utilities.getUTCDate(2019, GregorianCalendar.MARCH, 1).getTime(); public static boolean isMakersAccountAgeImmature(AccountAgeWitnessService accountAgeWitnessService, Offer offer) { long accountCreationDate = new Date().getTime() - accountAgeWitnessService.getMakersAccountAge(offer, new Date()); diff --git a/core/src/main/java/bisq/core/payment/PaymentAccountUtil.java b/core/src/main/java/bisq/core/payment/PaymentAccountUtil.java index 96a9e051de4..37c607b999e 100644 --- a/core/src/main/java/bisq/core/payment/PaymentAccountUtil.java +++ b/core/src/main/java/bisq/core/payment/PaymentAccountUtil.java @@ -44,18 +44,22 @@ public static boolean isRiskyBuyOfferWithImmatureAccountAge(Offer offer, Account AccountAgeRestrictions.isMakersAccountAgeImmature(accountAgeWitnessService, offer); } - public static boolean isSellOfferAndAnyTakerPaymentAccountForOfferMature(Offer offer, - Collection takerPaymentAccounts, - AccountAgeWitnessService accountAgeWitnessService) { + public static boolean isSellOfferAndAllTakerPaymentAccountsForOfferImmature(Offer offer, + Collection takerPaymentAccounts, + AccountAgeWitnessService accountAgeWitnessService) { + if (offer.isBuyOffer()) { + return false; + } + if (!OfferRestrictions.isSellOfferRisky(offer)) { - return true; + return false; } for (PaymentAccount takerPaymentAccount : takerPaymentAccounts) { if (isTakerAccountForOfferMature(offer, takerPaymentAccount, accountAgeWitnessService)) - return true; + return false; } - return false; + return true; } private static boolean isTakerAccountForOfferMature(Offer offer, @@ -96,7 +100,7 @@ public static ObservableList getPossiblePaymentAccounts(Offer of ObservableList result = FXCollections.observableArrayList(); result.addAll(paymentAccounts.stream() .filter(paymentAccount -> isTakerPaymentAccountValidForOffer(offer, paymentAccount)) - .filter(paymentAccount -> isTakerAccountForOfferMature(offer, paymentAccount, accountAgeWitnessService)) + .filter(paymentAccount -> offer.isBuyOffer() || isTakerAccountForOfferMature(offer, paymentAccount, accountAgeWitnessService)) .collect(Collectors.toList())); return result; } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/ClearXchangeForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/ClearXchangeForm.java index 9ecde3e17e2..83f65bfe62f 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/ClearXchangeForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/ClearXchangeForm.java @@ -47,7 +47,7 @@ public class ClearXchangeForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.owner"), ((ClearXchangeAccountPayload) paymentAccountPayload).getHolderName()); - addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.email.mobile"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.email.mobile"), ((ClearXchangeAccountPayload) paymentAccountPayload).getEmailOrMobileNr()); return gridRow; } diff --git a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java index e9d7db1716d..1f6efadec7c 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java @@ -436,7 +436,7 @@ private void onCreateOffer() { private void onShowInfo(Offer offer, boolean isPaymentAccountValidForOffer, boolean isRiskyBuyOfferWithImmatureAccountAge, - boolean isSellOfferAndAnyTakerPaymentAccountForOfferMature, + boolean isSellOfferAndAllTakerPaymentAccountsForOfferImmature, boolean hasSameProtocolVersion, boolean isIgnored, boolean isOfferBanned, @@ -453,7 +453,7 @@ private void onShowInfo(Offer offer, } else if (isRiskyBuyOfferWithImmatureAccountAge) { new Popup<>().warning(Res.get("offerbook.warning.riskyBuyOfferWithImmatureAccountAge", Res.get("offerbook.warning.newVersionAnnouncement"))).show(); - } else if (!isSellOfferAndAnyTakerPaymentAccountForOfferMature) { + } else if (isSellOfferAndAllTakerPaymentAccountsForOfferImmature) { new Popup<>().warning(Res.get("offerbook.warning.sellOfferAndAnyTakerPaymentAccountForOfferMature", Res.get("offerbook.warning.newVersionAnnouncement"))).show(); } else if (!hasSameProtocolVersion) { @@ -821,7 +821,7 @@ public TableCell call(TableColumn onShowInfo(offer, isPaymentAccountValidForOffer, isRiskyBuyOfferWithImmatureAccountAge, - isSellOfferAndAnyTakerPaymentAccountForOfferMature, + isSellOfferAndAllTakerPaymentAccountsForOfferImmature, hasSameProtocolVersion, isIgnored, isOfferBanned, diff --git a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java index fed5625ac56..f3a0d9ed6b9 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java @@ -509,9 +509,9 @@ boolean isAnyPaymentAccountValidForOffer(Offer offer) { PaymentAccountUtil.isAnyTakerPaymentAccountValidForOffer(offer, user.getPaymentAccounts()); } - boolean isSellOfferAndAnyTakerPaymentAccountForOfferMature(Offer offer) { + boolean isSellOfferAndAllTakerPaymentAccountsForOfferImmature(Offer offer) { return user.getPaymentAccounts() != null && - PaymentAccountUtil.isSellOfferAndAnyTakerPaymentAccountForOfferMature(offer, user.getPaymentAccounts(), accountAgeWitnessService); + PaymentAccountUtil.isSellOfferAndAllTakerPaymentAccountsForOfferImmature(offer, user.getPaymentAccounts(), accountAgeWitnessService); } boolean isRiskyBuyOfferWithImmatureAccountAge(Offer offer) {