Skip to content

Commit 51dde4d

Browse files
committed
fix error loading interac e-transfer offers
1 parent 19b8aaa commit 51dde4d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

core/src/main/java/haveno/core/offer/placeoffer/tasks/ValidateOffer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import haveno.core.offer.Offer;
2424
import haveno.core.offer.OfferDirection;
2525
import haveno.core.offer.placeoffer.PlaceOfferModel;
26+
import haveno.core.payment.PaymentAccount;
2627
import haveno.core.trade.HavenoUtils;
2728
import haveno.core.trade.messages.TradeMessage;
2829
import haveno.core.user.User;
@@ -96,6 +97,9 @@ public static void validateOffer(Offer offer, AccountAgeWitnessService accountAg
9697
/*checkArgument(offer.getMinAmount().compareTo(ProposalConsensus.getMinTradeAmount()) >= 0,
9798
"MinAmount is less than " + ProposalConsensus.getMinTradeAmount().toFriendlyString());*/
9899

100+
PaymentAccount paymentAccount = user.getPaymentAccount(offer.getMakerPaymentAccountId());
101+
checkArgument(paymentAccount != null, "Payment account is null. makerPaymentAccountId=" + offer.getMakerPaymentAccountId());
102+
99103
long maxAmount = accountAgeWitnessService.getMyTradeLimit(user.getPaymentAccount(offer.getMakerPaymentAccountId()), offer.getCurrencyCode(), offer.getDirection(), offer.hasBuyerAsTakerWithoutDeposit());
100104
checkArgument(offer.getAmount().longValueExact() <= maxAmount,
101105
"Amount is larger than " + HavenoUtils.atomicUnitsToXmr(maxAmount) + " XMR");

core/src/main/java/haveno/core/payment/InteracETransferAccount.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ public final class InteracETransferAccount extends PaymentAccount {
3636

3737
public static final List<TradeCurrency> SUPPORTED_CURRENCIES = List.of(new TraditionalCurrency("CAD"));
3838

39-
private final InteracETransferValidator interacETransferValidator;
40-
4139
private static final List<PaymentAccountFormField.FieldId> INPUT_FIELD_IDS = List.of(
4240
PaymentAccountFormField.FieldId.HOLDER_NAME,
4341
PaymentAccountFormField.FieldId.EMAIL_OR_MOBILE_NR,
@@ -50,8 +48,6 @@ public final class InteracETransferAccount extends PaymentAccount {
5048
public InteracETransferAccount() {
5149
super(PaymentMethod.INTERAC_E_TRANSFER);
5250
setSingleTradeCurrency(SUPPORTED_CURRENCIES.get(0));
53-
this.interacETransferValidator = HavenoUtils.corePaymentAccountService.interacETransferValidator;
54-
if (interacETransferValidator == null) throw new IllegalArgumentException("InteracETransferValidator cannot be null");
5551
}
5652

5753
@Override
@@ -102,6 +98,7 @@ public String getHolderName() {
10298
}
10399

104100
public void validateFormField(PaymentAccountForm form, PaymentAccountFormField.FieldId fieldId, String value) {
101+
InteracETransferValidator interacETransferValidator = HavenoUtils.corePaymentAccountService.interacETransferValidator;
105102
switch (fieldId) {
106103
case QUESTION:
107104
processValidationResult(interacETransferValidator.questionValidator.validate(value));

0 commit comments

Comments
 (0)